Grokking Microsoft Coding Interview
Ask Author
Back to course home

0% completed

Vote For New Content
 Manuel
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

Solution

Code

Time Complexity

Space Complexity