CS 24 Plan for Today: Implementing stacks (cont.) [TracingStack.pps] from Prof. Singh Template with array [stack1 .h, .template] Template with list [stack2 .h, .template] Complexity differences? Queue ADTs - FIFO: enqueue|push rear, dequeue|pop front e.g., STL queue: www.sgi.com/tech/stl/queue.html Queue applications Operating systems: job queues, printer queues With stack: check palindrome [pal.cxx] Simulations - e.g., car wash: see Section 8.2 Implementing queues (you get to practice in Lab07) Use array or list [chapt08.ppsx] Template with array [queue1 .h, .template] Template with list [queue2 .h, .template] Complexity differences? Implementing STL’s deque (section 8.4) Quick insert/remove either end [Fig. 8.12]