List reverse(List L)
{
List prep;
List p;
List q;
p = L->Next;
q = p->Next;
p->Next = NULL;
while (q) {
prep = p;
p = q;
q= q->Next;
p->Next = prep;
}
L->Next = p;
return L;
}
Vz提供的可读性高的版本