0 Charlotte x
1 Fred 0
2 Bert 1
3   4
4   5
5   6
6   7
7   8
8   9
9   x

A stack is last in first out. This means that we can not add or remove nodes in the middle of the stack. Notice that we are now pointing to the end of the list and the numbers pointers are reversed. The algorithims for pushing/popping -

Pushing

  1. Add the data to the node pointed to by the FreeSpace pointer.
  2. "FreeSpace" will then point to the next free node
  3. The next node will of the added node will become the tail pointer
  4. Tail pointer will then point to the newly added node.

Popping

  1. Go to the node pointed to by tail
  2. Set tail to be the next node pointer.
  3. The next node pointer will become "FreeSpace"
  4. Finally "freeSpace" will point to the removed node.