VC6
src:
{(1,0),(73,1),(73,2),(73,3),(73,4), }
(73,5),(1,6),(28,7),(1,8),(76,9), }
after sort:
{(1,0),(1,6),(1,8),(28,7),(73,1), }
(73,2),(73,3),(73,4),(73,5),(76,9), }
has same value.
no great index.
src:
{(65,0),(65,1),(0,2),(77,3),(77,4), }
(77,5),(0,6),(65,7),(95,8),(65,9), }
after sort:
{(0,2),(0,6),(65,0),(65,1),(65,7), }
(65,9),(77,3),(77,4),(77,5),(95,8), }
has same value.
no great index.
src:
{(44,0),(3,1),(53,2),(44,3),(44,4), }
(44,5),(3,6),(3,7),(98,8),(3,9), }
after sort:
{(3,1),(3,6),(3,7),(3,9),(44,0), }
(44,3),(44,4),(44,5),(53,2),(98,8), }
has same value.
no great index.
src:
{(39,0),(39,1),(76,2),(35,3),(76,4), }
(35,5),(35,6),(35,7),(76,8),(35,9), }
after sort:
{(35,3),(35,5),(35,6),(35,7),(35,9), }
(39,0),(39,1),(76,2),(76,4),(76,8), }
has same value.
no great index.
src:
{(4,0),(4,1),(37,2),(40,3),(40,4), }
(40,5),(40,6),(40,7),(4,8),(40,9), }
after sort:
{(4,0),(4,1),(4,8),(37,2),(40,3), }
(40,4),(40,5),(40,6),(40,7),(40,9), }
has same value.
no great index.
src:
{(63,0),(97,1),(97,2),(97,3),(63,4), }
(63,5),(17,6),(63,7),(97,8),(15,9), }
after sort:
{(15,9),(17,6),(63,0),(63,4),(63,5), }
(63,7),(97,1),(97,2),(97,3),(97,8), }
has same value.
no great index.
Press any key to continue
devc++4.9.9.0
src:
{(66,0),(66,1),(66,2),(66,3),(0,4), }
(0,5),(4,6),(66,7),(66,8),(0,9), }
after sort:
{(0,4),(0,5),(0,9),(4,6),(66,0), }
(66,1),(66,2),(66,3),(66,7),(66,8), }
has same value.
no great index.
src:
{(85,0),(77,1),(49,2),(77,3),(85,4), }
(6,5),(77,6),(6,7),(6,8),(85,9), }
after sort:
{(6,5),(6,7),(6,8),(49,2),(77,1), }
(77,3),(77,6),(85,0),(85,4),(85,9), }
has same value.
no great index.
src:
{(94,0),(57,1),(57,2),(57,3),(57,4), }
(9,5),(9,6),(57,7),(9,8),(94,9), }
after sort:
{(9,5),(9,6),(9,8),(57,1),(57,2), }
(57,3),(57,4),(57,7),(94,0),(94,9), }
has same value.
no great index.
src:
{(27,0),(26,1),(26,2),(11,3),(27,4), }
(16,5),(11,6),(27,7),(16,8),(26,9), }
after sort:
{(11,3),(11,6),(16,5),(16,8),(26,1), }
(26,2),(26,9),(27,0),(27,4),(27,7), }
has same value.
no great index.
src:
{(38,0),(25,1),(25,2),(25,3),(14,4), }
(25,5),(14,6),(25,7),(14,8),(14,9), }
after sort:
{(14,4),(14,6),(14,8),(14,9),(25,1), }
(25,2),(25,3),(25,5),(25,7),(38,0), }
has same value.
no great index.
src:
{(71,0),(36,1),(71,2),(36,3),(36,4), }
(4,5),(4,6),(36,7),(41,8),(71,9), }
after sort:
{(4,5),(4,6),(36,1),(36,3),(36,4), }
(36,7),(41,8),(71,0),(71,2),(71,9), }
has same value.
no great index.
vs2008
src:
{(57,0),(46,1),(66,2),(57,3),(66,4), }
(66,5),(85,6),(66,7),(46,8),(85,9), }
after sort:
{(46,1),(46,8),(57,0),(57,3),(66,2), }
(66,4),(66,5),(66,7),(85,6),(85,9), }
has same value.
no great index.
src:
{(93,0),(93,1),(22,2),(27,3),(36,4), }
(27,5),(93,6),(27,7),(93,8),(93,9), }
after sort:
{(22,2),(27,3),(27,5),(27,7),(36,4), }
(93,0),(93,1),(93,6),(93,8),(93,9), }
has same value.
no great index.
src:
{(31,0),(31,1),(31,2),(66,3),(31,4), }
(31,5),(31,6),(66,7),(66,8),(31,9), }
after sort:
{(31,0),(31,1),(31,2),(31,4),(31,5), }
(31,6),(31,9),(66,3),(66,7),(66,8), }
has same value.
no great index.
src:
{(26,0),(78,1),(2,2),(2,3),(87,4), }
(78,5),(2,6),(26,7),(87,8),(26,9), }
after sort:
{(2,2),(2,3),(2,6),(26,0),(26,7), }
(26,9),(78,1),(78,5),(87,4),(87,8), }
has same value.
no great index.
src:
{(67,0),(36,1),(67,2),(66,3),(36,4), }
(62,5),(36,6),(66,7),(66,8),(66,9), }
after sort:
{(36,1),(36,4),(36,6),(62,5),(66,3), }
(66,7),(66,8),(66,9),(67,0),(67,2), }
has same value.
no great index.
src:
{(61,0),(11,1),(48,2),(86,3),(61,4), }
(86,5),(61,6),(11,7),(61,8),(86,9), }
after sort:
{(11,1),(11,7),(48,2),(61,0),(61,4), }
(61,6),(61,8),(86,3),(86,5),(86,9), }
has same value.
no great index.
请按任意键继续. . .
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
pair<_RanIt, _RanIt> _Mid =
std::_Unguarded_partition(_First, _Last);
_Ideal /= 2, _Ideal += _Ideal / 2; // allow 1.5 log2(N) divisions
if (_Mid.first - _First < _Last - _Mid.second)
{ // loop on second half
std::_Sort(_First, _Mid.first, _Ideal);
_First = _Mid.second;
}
else
{ // loop on first half
std::_Sort(_Mid.second, _Last, _Ideal);
_Last = _Mid.first;
}
}
if (_ISORT_MAX < _Count)
{ // heap sort if too many divisions
std::make_heap(_First, _Last);
std::sort_heap(_First, _Last);
}
else if (1 < _Count)
std::_Insertion_sort(_First, _Last); // small
}
template<class _RanIt> inline
void sort(_RanIt _First, _RanIt _Last)
{ // order [_First, _Last), using operator<
_DEBUG_RANGE(_First, _Last);
std::_Sort(_CHECKED_BASE(_First), _CHECKED_BASE(_Last), _Last - _First);
}