Binary Search Visualizer#

Binary search finds a value in a sorted array in O(log n) time by repeatedly halving the range. Pick a target below and step through it: watch the low, mid, and high pointers close in. New to the idea? Read the Big-O cheat sheet or the binary search problem.

Enter a target and press Search.

Prefer sorting? See the sorting visualizer. Want to run the code yourself? Open the Python playground.