
The binary_search Algorithm
STL’s binary_search() algorithm traverses a sequence and returns a Boolean value indicating whether the sought-after element exists in that sequence. binary_search() is declared in the header as follows: bool binary_search