Skip to content
Back to categories

Searching

Algorithms that find items, positions, or answers in a collection.

Searching algorithms locate values or boundaries in data, from simple scans to methods that rely on sorted structure.

SearchingO(n)

Linear Search

Finds a target by checking items one by one until a match is found or the input ends.

BeginnerFoundationNo formula3 links
SearchLinear ScanClassic
SearchingO(log n)

Binary Search

Finds a target or insertion point in sorted data by repeatedly halving the candidate range.

BeginnerFoundationFormula19 links
SearchDivide and ConquerSorted DataClassic
SearchingO(log log n)

Interpolation Search

Searches sorted numeric data by estimating where the target should be.

IntermediateCoreFormula1 links
SearchSorted DataNumerical Methods
SearchingO(T log r)

Binary Search on Answer

Finds an optimal numeric answer by binary searching a monotone feasibility predicate.

IntermediateCoreFormula2 links
SearchOptimizationSorted Data
SearchingO(log i)

Exponential Search

Finds a search range by doubling the bound, then uses binary search inside it.

IntermediateCoreNo formula1 links
SearchSorted DataDivide and Conquer
SearchingO(log n)

Fibonacci Search

Searches sorted data using Fibonacci-sized partitions.

IntermediateCoreNo formula1 links
SearchSorted DataClassic
SearchingO(1)

Hash Lookup

Finds values by hashing keys directly to likely storage locations.

BeginnerCoreNo formula2 links
SearchHashingHash BasedData Structure
SearchingO(sqrt n)

Jump Search

Searches sorted data by jumping ahead in blocks before scanning a small block.

BeginnerCoreFormula1 links
SearchSorted DataLinear Scan
SearchingO(n)

Quickselect

Finds the kth smallest item by partitioning around pivots without fully sorting.

IntermediateCoreNo formula5 links
SearchOrder StatisticDivide and ConquerIn Place
SearchingO(log n)

Ternary Search

Finds an optimum in a unimodal range by comparing two interior points.

IntermediateCoreFormula1 links
SearchOptimizationNumerical Methods
SearchingO(log n)

Lower Bound

Finds the first sorted position where a value could be inserted without breaking order.

BeginnerCoreFormula2 links
SearchSorted DataDivide and Conquer
SearchingO(n)

Median of Medians

Selects a pivot that guarantees linear-time selection in the worst case.

AdvancedExtendedFormula2 links
SearchSelectionDivide and ConquerOrder Statistic
SearchingO(log n)

Uniform Binary Search

Uniform Binary Search uses ordering or monotonic structure to eliminate candidates.

IntermediateCoreNo formula1 links
Search
SearchingO(log n)

Galloping Search

Galloping Search locates items by exploiting structure in the collection or search space.

IntermediateCoreFormula1 links
Search
SearchingO(log n)

Rotated Array Search

Rotated Array Search uses ordering or monotonic structure to eliminate candidates.

IntermediateCoreNo formula1 links
Search
SearchingO(log n)

Peak Finding

Peak Finding uses ordering or monotonic structure to eliminate candidates.

IntermediateCoreFormula1 links
Search
SearchingO(log n)

Saddleback Search

Saddleback Search locates items by exploiting structure in the collection or search space.

IntermediateCoreFormula1 links
Search
SearchingO(log n)

Fractional Cascading

Fractional Cascading locates items by exploiting structure in the collection or search space.

IntermediateSpecializedNo formula1 links
Search
SearchingO(log n)

KD-Tree Nearest Neighbor Search

KD-Tree Nearest Neighbor Search finds nearby points while pruning distant candidates.

IntermediateCoreFormula4 links
Search
SearchingO(log n)

Ball Tree Search

Ball Tree Search locates items by exploiting structure in the collection or search space.

IntermediateExtendedNo formula2 links
Search
SearchingO(log n)

Vantage-Point Tree Search

Vantage-Point Tree Search locates items by exploiting structure in the collection or search space.

IntermediateSpecializedNo formula2 links
Search
SearchingO(log n)

Branch and Bound Nearest Neighbor

Branch and Bound Nearest Neighbor finds nearby points while pruning distant candidates.

IntermediateSpecializedNo formula2 links
Search
SearchingO(log n)

Bloom Filter Membership Query

Bloom Filter Membership Query locates items by exploiting structure in the collection or search space.

IntermediateCoreFormula2 links
Search
SearchingO(log n)

Binary Search in Answer Space

Binary Search in Answer Space uses ordering or monotonic structure to eliminate candidates.

IntermediateCoreFormula2 links
Search
SearchingO(n)

Floyd-Rivest Selection

Selects the kth order statistic by sampling to narrow the partition range.

IntermediateCoreNo formula3 links
SearchRandomness