void sort(Lnode *head)
{
Lnode *p, *q, *t;
p = head -> next;
while(p)
{
Lnode *min = p;
q = min -> next;
while(q)
{
if(q -> data < min -> data)
min = q;
q = q -> next
}
if(p -> data != min -> data)
{
int t = min -> data;
min -> data = p -> data;
p -> data = t;
}
p = p -> next;
}
}
登录后提交答案