Finished C++ Binary search algorithm