Skip to main content
HS
HiSETSuccess
LeetCode Prep

Algorithm Visualizer

Step through two pointers, sliding window, binary search, BFS/DFS, heaps, DP, and union-find one operation at a time.

← All visualizers

Binary Search

Halve the search range every step by comparing the target with the middle element.

O(log n) time · O(1) space

Up to 16 whole numbers in ascending order, then | and the value to find.

Presets
lo
2
0
5
1
8
2
12
3
16
4
23
5
38
6
56
7
72
8
hi
91
9

1/7Search for 23. The whole array (10 items) is still in play.

Keyboard: ← → step · Space play/pause