Lab 15: Prelab Questions

Write out your answers for these questions on a separate piece of paper.


Written Questions

Question #1: A stack is a sequence container allows inserts at the ____________ and removal at the ____________ of the sequence.

Question #2: A queue is a sequence container allows inserts at the ____________ and removal at the ____________ of the sequence.

Question #3: A stack is implemented with the ____________ class in the ____________ library; a queue is implemented with the ____________ class in the ____________ library.

Question #4: A stack is known as a "first in, ____________" container.

Question #5: A queue is known as a "first in, ____________" container.

Programming Exercises

Code #1: Write a declaration for a stack of ints named values.

Code #2: Write a declaration for a queue of doubles named moreValues.

Code #3: Write statements that inserts the value 3 to values and to moreValues.

Code #4: Write an expression that evaluates to the top value of values; write an expression that evaluates to the front value of moreValues.

Code #5: Write expressions that test if value and moreValues are empty.


Lab Home Page | Lab Exercise | Homework Projects
© 2003 by Prentice Hall. All rights reserved.
Report all errors to Jeremy D. Frens.