Sorting is not an out-dated topic. My own in-place qsort got TLE... so, I simply called stl::sort() to get AC.
This thread explains everything: http://stackoverflow.com/questions/5038895/does-stdsort-implement-quicksort Basic qsort has a worst case of O(n^2) and could result in too deep stack. The latest MinGW uses IntroSortInsertionSort. And Python 2.3+ uses TimSort
To learn these in depth...