Algorithms Analysis Stacks and Queues