COSC 350 Page 1 of 4 2/2/2009
COSC 350: Quiz 1 Name _____________________
Through Section 4.2
1. (15 pts.) Which data structure, a stack, queue, or deque, would be the most
appropriate for each of the following?
a) Holding activation records for subroutine calls
b) A LILO data structure
c) Keeping track of partial paths that need to be searched with a breadth-first search
strategy
d) Simulating a deck of cards where cards are dealt from the top of the deck and all
returned cards are added to the bottom of the deck
e) Simulating a ticket-line at the theater where people either, a) arrive, enter the line,
see it is too long, and leave before anyone else arrives, or, b) arrive, enter the line,
and wait until it is their turn to buy a ticket leaving the line once the ticket is
bought
2. (6 pts.) Rewrite (a+b)*(c+d) – e in:
a) prefix notation
b) postfix notation
3. (6 pts.) Evaluate the following:
a) + * + 1 2 3 4 * 5
b) 1 2 3 4 * + * 5 +