Binary search

1/6
Step 1 of 6

The idea

  • The list must be sorted.
  • Look at the middle value.
  • If it's too small, the answer is on the right. If it's too big, it's on the left.
  • Repeat on the half that's left.