Quicksort in C++ O(n log n)