binary search implementation in c++