Algorithms | Misc | Question 5

The minimum number of comparisons required to determine if an integer appears more than n/2 times in a sorted array of n integers is
(A) \theta(n)
(B) \theta(logn)
(C) \theta(log*n)
(D) \theta(n)

(A) A
(B) B
(C) C
(D) D


Answer: (B)

Explanation: Please see the post Check for majority element in a sorted array for details.

Quiz of this Question

My Personal Notes arrow_drop_up
Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.