CS 2401 Quiz #10

Date: Monday, October 25, 2010.
Name: ____________________________________________

1. Show, step-by-step, how to use a stack to compute the value of the postfix expression 12*34--.

2. Suppose that a queue of characters is implemented as an array of size 3. Show, step-by-step, what will happen if we start with an empty queue, enqueue a, enqueue b, dequeue, enqueue c, enqueue d, dequeue. Do not forget to indicate which element is the first and which is the last.

3. For extra credit: show, step-by-step, how to use a stack to convert the infix expression 1 * 2 - (3 - 4) into the above postfix form.