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 IntroSort\InsertionSort. And Python 2.3+ uses TimSort
To learn these in depth...
原文:http://www.cnblogs.com/tonix/p/3541659.html