Aspire Faculty ID #16988 · Topic: AMU MCA 2022 · Just now
AMU MCA 2022

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

Solution

Binary search is used to find first and last occurrence ⇒ logarithmic comparisons.

Previous 10 Questions — AMU MCA 2022

Nearest first

Next 10 Questions — AMU MCA 2022

Ascending by ID
Ask Your Question or Put Your Review.

loading...