Singly linked lists
- A list has data members head, tail, n
- head and tail are pointers to nodes in the list containing the first and last items.
- nodes contain an item and a pointer to another node (the single link).
- 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.
- n is the number of items in the list.
- The link in the tail node is NULL.
- The stack operation push puts a new node at the head.
- The stack operation pop removes the head node.
- The queue operation enqueue puts a new node at the tail.
- The queue operation dequeue is the same as pop.
- The deque operations could be addFirst = push, addLast = enqueue, removeFirst = pop.
- What about the deque operation removeLast?