Binary search compares a target with the middle item of a sorted array. It discards the half that cannot contain the target.
The search range halves at each step, so the number of steps grows logarithmically. Applying it to unsorted data can miss an existing value.
When to use
Use it to find a value or boundary in sorted data.