Beruflich Dokumente
Kultur Dokumente
head
next
element
node
element
link to the next node
C
Singly Linked Lists
D
2
Accessor Methods
node
Insert new
element
Have new
node point to
old head
Update head
to point to
new node
2014 Goodrich, Tamassia, Goldwasser
Insert new
element
Update tail to
point to new node
Java Methods
Allow
garbage
collector to
reclaim the
former first
node
Java Method
not efficient!
There is no constant-time way to update the
tail to point to the previous node
10