Which type of sorting is used in the std::sort()?

后端 未结 7 1231
无人共我
无人共我 2020-12-01 09:34

Can anyone please tell me that which type of sorting technique (bubble, insertion, selection, quick, merge, count...) is implemented in the std::sort() function

7条回答
  •  囚心锁ツ
    2020-12-01 09:51

    There are three algorithms that are used in MSVC2013 STL, referring to the source code of std::sort.

    It is most likely to use QuickSort, or a variation over QuickSort called IntroSort.

    If the recursion goes too deep, the HeapSort will be used here.

    Otherwise InsertSort will be used.

提交回复
热议问题