Queues Q.8

0. 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

  • Option : B
  • Explanation : Since it is a sorted array, we can use binary search to identify the position of the first occurrence of the given integer in (logn) steps. If at all these integer repeats, its appearance has to be continuous because the array is sorted.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *