Binary Search

012345678910

lower bound middle upper bound
0 5 10

Mess around

Refresh the page each time you run a new simulation.

What do you notice about the array before we perform a binary search?

Yes, it must be sorted into some kind of order - in this example ascending order.

When the array is in order, it can be searched using the binary search algorithm.

What condition is met if the search item is not in the array?

Worksheet Task

You will complete a coding challenge in your IDE.

Open the worksheet and follow the instructions.

Another visualization

Tags

lowerbounddivide and conquer upperbound middle compare sort assign loopalgorithm

Feelings

How do you feel right now?