CMPU-203: Introduction to Computer Science III

Quiz #4
Due: Monday, Nov. 19

  1. What is the difference between a deque and a vector?

  2. What are at least two operations for which lists are better than vectors?

  3. What are at least two operations for which deques are better than lists?

  4. Write a simple for-loop that, given a container c, a list l, and an iterator i that references a location in l, will merge all the elements of c into l, beginning at i (in l). Assume the two containers contain LessThanComparable elements, and use this comparison as the basis for the merge. You can not use the merge STL template, you must write a for-loop. After the loop, c should be unchanged, and l should contain the result of the merge.