Base impl for the second lecture exercises for queue & stack.