midterm 2 Flashcards
t/f A new node cannot become the first node in the list.
f
t/f The Standard Template Library (STL) contains templates for useful algorithms and data
structures
t
t/f A sequential container organizes data in a sequential fashion, similar to an array or linked
list.
t
t/f Inserting an item into a linked list requires that all the items past the point of the insertion
be shifted to make room for the new item.
f
t/f At most one catch block may be attached to a single try block.
f
t/f The values stored in the value portion of a node of a linked list can be simple data types,
structures, objects of classes, or any other data type.
t
t/f When you create a vector it is unnecessary to specify how many elements it will hold
because it will expand in size as you add new values to it.
t
t/f If an exception is not caught, it is stored for later use.
f
t/f Deleting an entire linked list requires a call to the delete operator for each node in the list.
t
t/f The C++ mechanism for exception handling encloses code that might throw an exception in
a try block and puts exception handling code in catch blocks attached to the try block.
t
t/f There is no difference between defining an object of an ordinary class and an object of a template class.
f
t/f When you create a linked list, you must know in advance how many nodes the list will
contain.
f
t/f Nodes in a linked list are stored in contiguous memory.
f
t/f The STL vector and list classes are examples of sequential containers.
t
t/f The following statement adds a new element to the department vector at index 25:
department.push_back(25);
f
t/f An exception is a condition that can be caused by a syntax error in the program.
f
t/f Using a function template often requires writing less code than overloading a function.
t