binary search and quick sort in C++