I know an inbuilt function as binary_search() for quickly searching a number from sorted array. I want to ask if same binary_search function is there in STL for vectors.
Yes. binary_search uses template and works with several data structures. See this example