You are viewing a single comment's thread. Return to all comments →
function reverse(llist) { var node = null; while(llist != null) { var temp = node; node = new SinglyLinkedListNode(llist.data,temp) node.next = temp llist = llist.next } return node
}
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 →
function reverse(llist) { var node = null; while(llist != null) { var temp = node; node = new SinglyLinkedListNode(llist.data,temp) node.next = temp llist = llist.next } return node
}