Back to course home
0% completed
Vote For New Content
Recursive Solution
Manuel
Jan 9, 2025
class Solution { public ListNode reverse(ListNode head) { return performReverse(null, head); } private ListNode performReverse(ListNode previous, ListNode current ){ if (current==null) { return previous; } ListNode next = current.next; current.next = previous; return performReverse( current,next); } }
0
0
Comments
Comments
On this page
Problem Statement
Try it yourself