Back to All Algorithms
Binary Search
Category: Searching | Time: O(log n) | Space: O(1)
Visualization
Visual representation of the data structure
Enter an algorithm and input to start visualization.
About Binary Search

An efficient algorithm for finding an item from a sorted list of items. It works by repeatedly dividing in half the portion of the list that could contain the item, until you've narrowed down the possible locations to just one.

Code Editor
The code is for reference. Editing it won't affect the visualization.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Frequently Asked Questions
About Binary Search