re-implemented all four instantiation patterns of stacks and queues