You are viewing a single comment's thread. Return to all comments →
JavaScript
function getNode(llist, positionFromTail) { const values = []; let currentNode = llist; while (currentNode) { values.push(currentNode.data); currentNode = currentNode.next; } return values.reverse()[positionFromTail]; }
Seems like cookies are disabled on this browser, please enable them to open this website
Get Node Value
You are viewing a single comment's thread. Return to all comments →
JavaScript