ods
ods copied to clipboard
SLList wrong function addAfter
Line 120
protected void addAfter(Node u, Node v) {
v = u.next.next;
u.next = v;
if (u == tail)
tail = v;
}
the v=u.next.next; seems wrong, this function will only delete the node after u
The solution is to make v = u.next.next; --> v.next = u.next;