PList pReverseList(PList head)
{
PList p1 = NULL;
PList p2 = head;
PList p3 = NULL;
while (p2 != NULL)
{
p3 = p2->next;
p2->next = p1;
p1 = p2;
p2 = p3;
}
return p1;
}
PList pReverseList(PList head)
{
PList p1 = NULL;
PList p2 = head;
PList p3 = NULL;
while (p2 != NULL)
{
p3 = p2->next;
p2->next = p1;
p1 = p2;
p2 = p3;
}
return p1;
}
下一篇 [数组] 最大子数组之和