Implement an algorithm to delete a node in the middle of a singly linked list, given only access to that node.
1->2->3->4, and node
Since we are only given the reference to a node in the middle of a singly linked list, we cannot just unlink the node we want to remove, as we usually do.
The way to remove this node is to shift all the values after the current node and remove the last node of the list.
A Java implementation follows.