Skip to content
Related Articles

Related Articles

GATE | GATE CS 2021 | Set 1 | Question 12

View Discussion
Improve Article
Save Article
  • 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

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!