Fixed Bug in LinkedList
Fixed a bug in LinkedList - the size of the list never increased when elements were added.
This commit is contained in:
parent
d2da74ea76
commit
27b21f6674
1 changed files with 1 additions and 0 deletions
|
@ -226,6 +226,7 @@ public class LinkedList<T> implements Iterable<T>
|
|||
Node<T> addition = new Node(node, node.next, data, this);
|
||||
node.next = addition;
|
||||
addition.next.prev = addition;
|
||||
size++;
|
||||
return addition;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue