List Reverse(List L)
{
List p, q;
p = L;
q = L;
L = NULL;
while (p)
{
p = p->Next;
q->Next = L;
L = q;
q = p;
}
return L;
}
[PTA] 数据结构与算法题目集 6-1 单链表逆转
最新推荐文章于 2021-08-28 10:08:25 发布
List Reverse(List L)
{
List p, q;
p = L;
q = L;
L = NULL;
while (p)
{
p = p->Next;
q->Next = L;
L = q;
q = p;
}
return L;
}