Reverse a linked list.
Anonymous
Node ReverseLinkedList(Node head) { Node next = head.next; if (next == null) { return head; } Node revList = ReverseLinkedList(head.next); next.next = head; head.next = null; return revList; }
Check out your Company Bowl for anonymous work chats.