Master Mathematics.

Programming · Hard · Searching, Sorting & Complexity · Problem 1

Comparisons in an unsuccessful binary search

is a sorted array of distinct integers, and a recursive binary search looks for ; each step makes one comparison of the middle element with (equal, less or greater). The maximum number of comparisons if is not in is .

Source: GATE DA