public static Node reverse(Node head)
{
Node p = head.next;
Node q = p.next;
p.next = null;
while(q != null)
{
p = q;
q=
p.next;
p.next = head.next;
head.next =
p;
}
return head;
}
原文:http://www.cnblogs.com/godfatherback/p/3561445.html