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:
@@ -226,6 +226,7 @@ public class LinkedList<T> implements Iterable<T>
|
|||||||
Node<T> addition = new Node(node, node.next, data, this);
|
Node<T> addition = new Node(node, node.next, data, this);
|
||||||
node.next = addition;
|
node.next = addition;
|
||||||
addition.next.prev = addition;
|
addition.next.prev = addition;
|
||||||
|
size++;
|
||||||
return addition;
|
return addition;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user