Overview
Galloping Search is a search method that uses ordering, indexing, predicates, or distance bounds to eliminate candidates. It is a good fit when the collection has enough structure to avoid checking every candidate.
Galloping Search locates items by exploiting structure in the collection or search space.
Compact metadata for implementation and discovery.
Galloping Search is a search method that uses ordering, indexing, predicates, or distance bounds to eliminate candidates. It is a good fit when the collection has enough structure to avoid checking every candidate.
Quick facts
Runtime and memory behavior at a glance.
Best
O(1)
Average
O(log n)
Worst
O(n)
Space
O(1)
high = 2^k until array[high] >= targetExpands the search interval exponentially before binary searching inside it.
Show candidate regions shrinking as comparisons or distance tests eliminate options.
Galloping Search operates in O(log n) time and O(1) space within the Search family. Key governing relation: high = 2^k until array[high] >= target. Often compared with Binary Search and Linear Search.
What each reference supports for this entry.
Algorithms textbook support for Galloping Search's exponential range discovery followed by binary search.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
Galloping Search and Binary Search address nearby searching problems but make different implementation tradeoffs.