merge sort implementation in C++