Reverse
public ListNode Reverse(ListNode root){
if (root == null || root.next == null) return root;
ListNode newHead = Reverse(root.next);
root.next.next = root;
root.next = null;
return newHead;
}Last updated
public ListNode Reverse(ListNode root){
if (root == null || root.next == null) return root;
ListNode newHead = Reverse(root.next);
root.next.next = root;
root.next = null;
return newHead;
}Last updated