AlgoViz

Binary search

easy 16 min

Binary search finds a value, a boundary or an insertion point in sorted data by checking the middle and discarding the half that cannot hold the answer.

Check yourself

One question at a time. Each answer explains why.

Question 1 of 10

Score 0
conceptual

What is the time complexity of binary search on a sorted array of n elements?

Pick an answer to see why.

Flashcards

Say your answer, then reveal it.

Card 1 of 12

Recall

What does binary search do on each step?

Say your answer, then reveal it.

These cards come back in Today, just before you would forget them.