Look in the middle of a sorted array and throw away the half that cannot hold x.
This interactive visualization needs JavaScript.