You are viewing a single comment's thread. Return to all comments →
javascript solution:
` function reverse(llist) { let prev, next = null;
while (llist !== null) { [next, llist.next] = [llist.next, prev]; [prev, llist] = [llist, next]; } return prev;
} `
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 →
javascript solution:
` function reverse(llist) { let prev, next = null;
} `