Singly linked lists

  1. A list has data members head, tail, n
  2. head and tail are pointers to nodes in the list containing the first and last items.
  3. nodes contain an item and a pointer to another node (the single link).
  4. head and tail are both NULL if the list is empty. Head and tail point to the same node when the list has one item.
  5. n is the number of items in the list.
  6. The link in the tail node is NULL.
  7. The stack operation push puts a new node at the head.
  8. The stack operation pop removes the head node.
  9. The queue operation enqueue puts a new node at the tail.
  10. The queue operation dequeue is the same as pop.
  11. The deque operations could be addFirst = push, addLast = enqueue, removeFirst = pop.
  12. What about the deque operation removeLast?