Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

recursively reverse linked list

 public ListNode ReverseList(ListNode head) 
 {
   if(head==null || head.next == null)
   	return head;

  var t = ReverseList(head.next);
  head.next.next = head;
  head.next = null;

  return t;
}
Source by leetcode.com #
 
PREVIOUS NEXT
Tagged: #recursively #reverse #linked #list
ADD COMMENT
Topic
Name
5+5 =