You are viewing a single comment's thread. Return to all comments →
js solution function deleteNode(llist, position) { // Write your code here let currentNode = llist;
if (position===0) { llist=llist.next; return }; for (let i = 0; i < position - 1; i++) { currentNode = currentNode.next; }
currentNode.next=currentNode.next.next
return llist
}
Seems like cookies are disabled on this browser, please enable them to open this website
Delete a Node
You are viewing a single comment's thread. Return to all comments →
js solution function deleteNode(llist, position) { // Write your code here
let currentNode = llist;
currentNode.next=currentNode.next.next
return llist
}