Skip to content
Related Articles

Related Articles

Improve Article

GATE | GATE CS 2021 | Set 1 | Question 12

  • Difficulty Level : Hard
  • Last Updated : 24 May, 2021

Let P be an array containing n integers. Let t be the lowest upper bound on the number of comparisons of the array elements, required to find the minimum and maximum values in an arbitrary array of n elements. Which one of the following choices is correct?
(A) t>2n−2
(B) t>3⌈n/2⌉ and t≤2n−2
(C) t>n and t≤3⌈n/2⌉
(D) t>⌈log2(n)⌉ and t≤n

Answer: (B)

Explanation: It will take t≤2n−2 comparisons without divide and conquer technique.

It will take t≤ 3⌈n/2⌉ – 2 with divide and conquer technique.

Quiz of this Question

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.

My Personal Notes arrow_drop_up
Recommended Articles
Page :