real world examples of stacks: spring-loaded stack of plates at a restaurant boarding and leaving a plane (non elite/1st class folk) Pez dispenser real world examples of queues: waiting in line computer uses of stacks: how a computer does recursion, method calls (exceptions pop up the stack until caught) reverse pollish notation on calculators OpenGL matrix transformations for multi-link models computer uses of queues: how an OS does scheduling (priority queue) printer queue Java finally got stacks/queues -- used to have to use deque (doubly linked list) and ignore some of the methods Java has: stack: push, pop, peek (top), search (how many pops to find item), size, isEmpty queue: offer (enqueue), remove (dequeue), peek (front), poll (remove without throwing exception on empty queue), size, isEmpty all but search is O(1) Can implement stacks/queues as arrays or linkedlists, though as array, queue a little tricky... it has front and back positions and can wrap around. (circular buffers common in OS) stacks good for reversing things reverse polish notation: 4 3 + 6 * push 4, push 3, + means (pop 3, pop 4, push (3+4=7), push 6, * means (pop 6, pop 7, push 6*7=42).