From 564354ad8ef2044e68f5a26b155bfe0f4c9397c2 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 22 Jan 2014 12:36:23 +0100 Subject: add headless linked lists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/datastructures/linkedlists/template | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/datastructures/linkedlists/template') 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); } -- cgit v1.2.3-70-g09d2