I want to find whether a given element is present in a array or not using the function binary_search(). But before passing the array as argument, do I need to sort it or will sorting automatically done by the function? asked 28 Mar '15, 21:46 ![]()
|
you need to sort it. see more info http://www.cplusplus.com/reference/algorithm/binary_search/ answered 28 Mar '15, 21:56 ![]()
|