Lab 13: Prelab Questions


Written Questions

Question #1: The values in a vector are stored in ____________ memory locations.

Question #2: The values in a list are stored in ____________ memory locations.

Question #3: O(__) is constant time and O(__) is linear time.

Question #4: The ____________ is a special node at the beginning of a list.

Question #5: ____________ are used to link the nodes of a list together.

Programming Exercises

Code #1: Write declarations for a list aList of doubles and a vector aVec of doubles.

Code #2: Write expressions for the lengths of aList and aVec.

Code #3: Write statements that add the value 3.14159 at the end of aList and at the end of aVec.

Code #4: Write statements that add the value 2.7183 at the front of aList and at the front of aVec.

Code #5: Write statements that remove the last value in aList and the last value in aVec.


Lab Exercise
Report errors to Larry Nyhoff (nyhl@cs.calvin.edu)