void select_sort(int a[], int len)
{
int i, j, x, l;
for(i = 0; i < len; i++)
{
x = a[i];
l = i;
for(j = i; j < len; j++)
{
if(a[j] < x)
{
x = a[j];
l = j;
}
}
a[l] = a[i];
a[i] = x;
}
}
选择排序算法
最新推荐文章于 2024-04-19 14:04:07 发布