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.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Interpolation Search
- Meta Binary Search | One-Sided Binary Search
- Why is Binary Search preferred over Ternary Search?
- Linear Search vs Binary Search
- Sublist Search (Search a linked list in another list)
- Repeatedly search an element by doubling it after every successful search
- Best First Search (Informed Search)
- The Ubiquitous Binary Search | Set 1
- Unbounded Binary Search Example (Find the point where a monotonically increasing function becomes positive first time)
- A Problem in Many Binary Search Implementations
- Longest Common Prefix using Binary Search
- Finding minimum vertex cover size of a graph using binary search
- Binary Search functions in C++ STL (binary_search, lower_bound and upper_bound)
- Binary Search
- Binary Search for Rational Numbers without using floating point arithmetic
- Randomized Binary Search Algorithm
- Leaf nodes from Preorder of a Binary Search Tree
- C Program for Binary Search (Recursive and Iterative)
- Binary Search using pthread
- Find square root of number upto given precision using binary search