append(value)
which adds a new node with the given value to the end of the list
insertBefore(value, newVal)
which add a new node with the given newValue immediately before the first value node
insertAfter(value, newVal)
which add a new node with the given newValue immediately after the first value node
kthFromEnd(k)
which returns the node’s value that is k from the end of the linked list.
write functions that can insert a node into a linked list either before, after, or at the end of other nodes in the list.
Write a method for the Linked List class which takes a number, k, as a parameter. Return the node’s value that is k from the end of the linked list.
time: O(n)
space: O(n)