Searching and Sorting Algorithms in C++