Binary search step by step

[2, 5, 7, 9, 12, 15, 20], looking for 12 → 9, 15, 12

You can also choose a level by clicking its number.

About the course

Description
Which elements of a sorted array the searched number is compared with, one after another
More information
Arrays are indexed from zero. Sorting is ascending (from the smallest) unless stated otherwise.
Sample question
[2, 5, 7, 9, 12, 15, 20], looking for 12 → 9, 15, 12
Author
Jiří Preisler
Version
1.0