Jump Search vs Exponential Search
Across our 4 test inputs, Jump Search needed 21 comparisons in total versus 25 for Exponential Search. On average Jump Search runs in O(√n) time and Exponential Search in O(log n).
Head-to-head on identical inputs (comparisons)
| Input | Jump Search | Exponential Search |
|---|---|---|
| Target is first | 2 | 1 |
| Target in the middle | 4 | 7 |
| Target is last | 8 | 9 |
| Target absent | 7 | 8 |
Complexity
| Jump Search | Exponential Search | |
|---|---|---|
| Average time | O(√n) | O(log n) |
| Worst time | O(√n) | O(log n) |
| Space | O(1) | O(1) |
| Stable | No | No |
When to use Jump Search
Sorted data where jumping backwards is expensive (e.g. linked storage or tape-like media).
When to use Exponential Search
Unbounded or very large sorted lists, or when the target is likely near the start.