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
O(log n) time · O(1) spaceBinary Search
Halve the search range every step by comparing the target with the middle element.
lo
2
05
18
212
316
423
538
656
772
8hi
91
91/7Search for 23. The whole array (10 items) is still in play.
Keyboard: ← → step · Space play/pause