public void selectSort(int[]s)
{
int Index;
int min;
for (int i = 0; i < s.Length-1; i++)
{
Index = i;
for (int j = i+1; j < s.Length; j++)
{
Index = s[Index] < s[j] ? Index : j;
}
min = s[Index];
s[Index] = s[i];
s[i] = min;
}
}
四、选择排序
于 2022-03-09 17:11:33 首次发布