我一直在搜索一阵子,但是我找不到视觉c ++对std :: sort函数使用什么算法,我知道GNU Standard C ++库使用Introsort,但是似乎没有任何来源讲微软的视觉c ++使用哪一个!
使用源Luke :)对其进行快速排序(MSVC 2013),有时使用堆排序甚至插入排序(基于容器的大小)
template<class _RanIt,
class _Diff> inline
void _Sort(_RanIt _First, _RanIt _Last, _Diff _Ideal)
{ // order [_First, _Last), using operator<
_Diff _Count;
for (; _ISORT_MAX < (_Count = _Last - _First) && 0 < _Ideal; )
{ // divide and conquer by quicksort
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句