哪个排序算法是使用微软的STL ::目录::排序()? [英] Which sorting algorithm is used by Microsoft's STL::list::sort()?
问题描述
注:我不小心发布<一个href="http://stackoverflow.com/questions/1717773/which-sorting-algorithm-is-used-by-stls-listsort">this问题没有指明哪些STL实现我所用,我觉得它真的不能被更新,因为它会使大部分答案已经过时了。的
所以,正确的问题去 - 这排序算法采用的是低于code,假设我使用微软的Visual C ++?:
的STL库 列表&LT; INT&GT; mylist中;
// ..insert百万值
mylist.sort();
只是让你不必依靠二手资料,排序code是正确的列表
头 - 这是关于35行。
看来是修改后的迭代(非递归)合并排序多达25箱(我不知道是否有这种变异合并排序的特定名称)。
Note: I accidentally posted this question without specifying which STL implementation I was using, and I felt it can't really be updated since it would render most of its answers obsolete.
So, the correct question goes - which sorting algorithm is used in the below code, assuming I'm using the STL library of Microsoft Visual C++?:
list<int> mylist;
// ..insert a million values
mylist.sort();
Just so you don't have to rely on second hand information, the the sort code is right in the list
header - it's about 35 lines.
Appears to be a modified iterative (non-recursive) merge sort with up to 25 bins (I don't know if there's a particular name for this variant of merge sort).
这篇关于哪个排序算法是使用微软的STL ::目录::排序()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!