STL library uses IntroSort, which is a hybrid of QuickSort, HeapSort and InsertionSort

  • Small array => InsertionSort
  • Default => QuickSort
  • if QuickSort seems to perform not well, switch to HeapSort