⚡ AlgoZen_
~/home/arrays_&_hashing/binary_search1 / 3

Binary Search

Beginner

Efficiently find an element in a sorted array by repeatedly halving the search space. Each comparison eliminates half the remaining candidates.

time:O(log n)
space:O(1)
⚡ +100_XP
step[1/3]
> Start
lo
2
5
8
12
16
23
38
45
56
72
hi
91
We're looking for target = 23 in a sorted array of 11 elements.

// tap NEXT STEP to walk through one step at a time