The pseudo code to describe the algorithms uses these terms
Problems:
head = null
if (head == null)
// list is empty
p = head
while p is not null and p>info is not x
access p>info
p = p>link
p>info = x
current = head
while current is not null and current>info < x
previous = current
current = current>link
if current is head
p>link = head
head = p
else
previous>link = p
p>link = current
if current is not null
if current points to the first node
head = current>link
if current does not point to the first node
previous>link = current>link
destroy the current node
When writing linked list algorithms, always look at special cases:
