GATE CS 2021, set 1 · Question 12 · Algorithms · Multiple choice (MCQ) · 1 mark · −1/3 for a wrong answer
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 > ⌈ log₂(n) ⌉ and t ≤ n
Answer
Answer (C)
Answer from the official GATE CS 2021 answer key.
The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes