CMPU-203: Introduction to Computer Science III

Quiz #9
Due: Monday, Nov. 19

For each of the following situations, pick the algorithm you would use to best solve the problem. When multiple choices seem possible, select the best one and say why. You don't need to show how to call it, you only need to select one of the algorithms. If no algorithm exists, suggest a way to do it.

  1. You have a string and you want to know if the string "xyz" appears somewhere within it.

  2. You have two sorted containers of students, and you need to know if there is any student on one list that isn't on the other. If there is one, you need to know what it is.

  3. You need to know how many students in a container are taking more than 3 courses.

  4. You have a container of faculty, whose instances have a private data member called salary. You need to increase the salary of each element of the container by 4%.