Node reverseList(Node head)
{
if(head == null || head.next == null)
return head;
Node p = reverseList(head.next);
head.next.next = head;
head.next = null;
return p;
}
Node reverseList(Node head)
{
if(head == null || head.next == null)
return head;
Node p = reverseList(head.next);
head.next.next = head;
head.next = null;
return p;
}