Question | Answer |
Swap Nodes in Pairs | public ListNode swapPairs(ListNode head) { if(head == null || head.next == null) return head; ListNode n = head.next; head.next = swapPairs(head.next.next); n.next = head; return n; } |
There are no comments, be the first and leave one below:
Want to create your own Flashcards for free with GoConqr? Learn more.