Interpolation search works better than Binary Search for a sorted and uniformly distributed array.
On average the interpolation search makes about log(log(n)) comparisons (if the elements are uniformly distributed), where n is the number of elements to be searched. In the worst case (for instance where the numerical values of the keys increase exponentially) it can make up to O(n) comparisons.
- Exponential Search
- Linear Search vs Binary Search
- Interpolation Search
- Jump Search
- Why is Binary Search preferred over Ternary Search?
- K'th Smallest/Largest Element in Unsorted Array | Set 2 (Expected Linear Time)
- A Problem in Many Binary Search Implementations
- Binary Search
- Find the minimum element in a sorted and rotated array
- Find a peak element
- The Ubiquitous Binary Search | Set 1
- Find a Fixed Point (Value equal to index) in a given array
- Find the repeating and the missing | Added 3 new methods
- Count number of occurrences (or frequency) in a sorted array
- Median of two sorted arrays of same size