Jump Search vs Interpolation Search

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

Head-to-head on identical inputs (comparisons)

InputJump SearchInterpolation Search
Target is first21
Target in the middle42
Target is last81
Target absent72

Complexity

Jump SearchInterpolation Search
Average timeO(√n)O(log log n)
Worst timeO(√n)O(n)
SpaceO(1)O(1)
StableNoNo

When to use Jump Search

Sorted data where jumping backwards is expensive (e.g. linked storage or tape-like media).

When to use Interpolation Search

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