DSAverse
Searching Algorithms
Loading Searching Algorithms...
Search Visualization
Initializing Sorting Algorithms...
Sorting
Trees
Graphs
Preparing interactive visualizations...
Searching Algorithms
Loading Searching Algorithms...
Search Visualization
Master the art of finding elements efficiently. From simple linear scans to logarithmic divide-and-conquer — visualize every comparison step by step.
Sequential scan through every element until the target is found. Works on any array — sorted or unsorted — and finds all occurrences in one pass.
O(n)O(1)Repeatedly halves the search space by comparing the target with the midpoint element. The gold standard for searching sorted arrays.
O(log n)O(1)Jumps ahead in steps of √n to find the right block, then scans linearly within that block. A practical middle-ground between linear and binary.
O(√n)O(1)Estimates the target's position using value proportions — like looking up a name in a phone book. Excels on uniformly distributed data.
O(log log n)O(1)Doubles the bound (1 → 2 → 4 → 8 …) to find a range where the target lies, then applies binary search within that range.
O(log n)O(1)Divides the array using Fibonacci numbers. Avoids division entirely — uses only addition and subtraction to compute probe positions.
O(log n)O(1)Splits the range into three equal thirds using two midpoints, eliminating one third per iteration. An interesting theoretical variant of binary search.
O(log₃ n)O(1)Scans block endpoints in steps of √n to identify the correct block, then searches linearly within it. Also known as Jump Search.
O(√n)O(1)Searching is one of the most fundamental operations in programming. Choosing the right algorithm can be the difference between milliseconds and minutes.
Searching underpins databases, file systems, and nearly every application. Understanding the trade-offs helps you pick the right tool every time.
From O(n) to O(log log n) — algorithm choice dramatically affects speed, especially at scale. Switching to binary search can cut millions of comparisons.
Binary search powers database indexes. Interpolation search models phone-book lookups. Exponential search handles infinite or unbounded data streams.