C++ quick/merge sort