Binary Search vs Exponential Search

Across our 4 test inputs, Binary Search needed 17 comparisons in total versus 25 for Exponential Search. Binary Search is stable; Exponential Search is not.

Head-to-head on identical inputs (comparisons)

InputBinary SearchExponential Search
Target is first41
Target in the middle47
Target is last59
Target absent48

Complexity

Binary SearchExponential Search
Average timeO(log n)O(log n)
Worst timeO(log n)O(log 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 Exponential Search

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