aboutsummaryrefslogtreecommitdiffstats
path: root/src/datastructures/linkedlists/template
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/datastructures/linkedlists/template5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/datastructures/linkedlists/template b/src/datastructures/linkedlists/template
index 0a24a89..71c6a84 100644
--- a/src/datastructures/linkedlists/template
+++ b/src/datastructures/linkedlists/template
@@ -193,7 +193,7 @@
node.next = successor;
if (node.previous != null)
node.previous.next = node;
-£>if (( with_tail )); then
+£>if (( with_head )); then
if (this.head == successor)
this.head = node;
£>fi
@@ -252,7 +252,10 @@
public Node insertEnd(T value)
{
if (this.tail == null)
+£>(( with_head )) &&
return insertBeginning(value);
+£>(( with_head )) ||
+ return this.tail = new Node(value);
return insertAfter(value, this.tail);
}