Dynamic Stacks and Circular Queues