C++ · Vectors

Sorting and binary search

Searching a thousand sorted values one by one takes up to a thousand checks; halving the range each time takes ten.