You are viewing a single comment's thread. Return to all comments →
JS Recusrive solution:
function reverse(llist) { if (!llist || !llist.next) { return llist; } let newHead = reverse(llist.next); llist.next.next = llist; llist.next = null; return newHead; }
Seems like cookies are disabled on this browser, please enable them to open this website
Reverse a linked list
You are viewing a single comment's thread. Return to all comments →
JS Recusrive solution: