Merge sort algorithm implemented in C++