Binary search

On a sorted list, each step keeps the half that can still hold the target. Level: standard.

Learning goals

Simulation

The list is sorted. This is not a search of an unsorted list.

Formulas

Worked example: sorted list 3, 8, 14, 21, 27, 33, 40. Target 27.

Quiz

Binary search on this page requires the list to be what?
If the middle value is too low, which side is kept?

Answers
  • Binary search on this page requires the list to be what? Answer: Sorted.
  • If the middle value is too low, which side is kept? Answer: The right side.

Built from a fixed lesson set. No model call. No network script. Once loaded, this page does not fetch.