Binary Search vs Jump Search

Across our 4 test inputs, Binary Search needed 17 comparisons in total versus 21 for Jump Search. On average Binary Search runs in O(log n) time and Jump Search in O(√n). Binary Search is stable; Jump Search is not.

Head-to-head on identical inputs (comparisons)

InputBinary SearchJump Search
Target is first42
Target in the middle44
Target is last58
Target absent47

Complexity

Binary SearchJump Search
Average timeO(log n)O(√n)
Worst timeO(log n)O(√n)
SpaceO(1)O(1)
StableYesNo

When to use Binary Search

Sorted arrays when O(log n) search time is needed. Foundation for many advanced algorithms.

When to use Jump Search

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