Interpolation Search vs Exponential Search

Across our 4 test inputs, Interpolation Search needed 6 comparisons in total versus 25 for Exponential Search. On average Interpolation Search runs in O(log log n) time and Exponential Search in O(log n).

Head-to-head on identical inputs (comparisons)

InputInterpolation SearchExponential Search
Target is first11
Target in the middle27
Target is last19
Target absent28

Complexity

Interpolation SearchExponential Search
Average timeO(log log n)O(log n)
Worst timeO(n)O(log n)
SpaceO(1)O(1)
StableNoNo

When to use Interpolation Search

Large sorted arrays whose values are roughly uniformly distributed (IDs, timestamps).

When to use Exponential Search

Unbounded or very large sorted lists, or when the target is likely near the start.