# STL Function: Binary_search()

In some cases, we just want to if an element exists in a sorted list, then we can use the STL function: binary_search(). To use this function, you must include the header <algorithm>. Note before we use binary_search(), the list must be sorted, either in ascending order or in descending order. …… Here is a simpler example explaining how to use this function.