冒泡排序:
void BubbleSort(elemtype x[],int n)
{
int i,j;
elemtype temp;
for(i=1;i<n;i++)
for(j=0;j<n-i;j++)
{
if(x[j].key>x[j+1].key)
{
temp=x[j];
x[j]=x[j+1];
x[j+1]=temp;
}
}
}
转载于:https://my.oschina.net/u/1760583/blog/706215
39万+

被折叠的 条评论
为什么被折叠?



