DSAverse
Searching Algorithms
Loading Searching Algorithms...
Search Visualization
3
9
14
21
28
35
47
56
63
72
sorted arrayindex 0
Initializing Sorting Algorithms...
Sorting
Trees
Graphs
Preparing interactive visualizations...
Searching Algorithms
Loading Searching Algorithms...
Search Visualization
Repeatedly halve the search space by comparing the target with the middle element. Requires a sorted array but finds in O(log n) — the gold standard for sorted data.
Ready — press Play or step through.
Question 1 of 3
What precondition is required for binary search to work correctly?