Stacks and Queues: Building Efficient Data Structures