You are viewing a single comment's thread. Return to all comments →
js
function reverse(llist) { let prev = null let current = llist let next = null while(current !== null) { next = current.next current.next = prev prev = current current = next } llist = prev return llist }
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