posted 13 years ago
What you do is to draw three squares, labelled last temp and previous. Then you put lines between them for each action, or erase the lines, and you find whether you are adding the new node to the right or the left of the original node.
Also, why are you saying "if (current == last)"? That would only add a node at the end of the list, and presumably you want to be able to paste into the middle.