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.
- Interpolation Search
- Why is Binary Search preferred over Ternary Search?
- Count number of occurrences (or frequency) in a sorted array
- Find the repeating and the missing | Added 3 new methods
- Find the minimum element in a sorted and rotated array
- Numbers within a range that can be expressed as power of two numbers
- Check if all occurrences of a character appear together
- Longest Palindromic Substring using Palindromic Tree | Set 3
- k-th missing element in sorted array
- Count palindromic characteristics of a String