我有选择排序算法的这种实现。如何使这个实现稳定?我觉得不可能/
int selection_sort1 ( int ai_numbers[], const int ci_count )
{
int counter = 0;
int i, minIndex, j;
for ( i = 0; i < ci_count; i++ )
{
minIndex = i;
for ( j = i + 1; j < ci_count; j++ )
{
if ( ai_numbers[j] < ai_numbers[minIndex] )
{
minIndex = j;
}
}
swap ( &ai_numbers[i], &ai_numbers[minIndex] );
counter++;
}
return counter;
}