InterviewSolution
FUNCTION REVERSE(HEAD) {let NODE = head,previous,tmp;while (node) {// save next before we OVERWRITE node.next!tmp = node.next;node.next = previous;previous = node;node = tmp;}return previous;}
Your experience on this site will be improved by allowing cookies. Read Cookie Policy