q7 sol - CSCI.1100 Computer Science I Quiz 7 November 2,...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CSCI.1100 Computer Science I Quiz 7 November 2, 2009 Closed book, closed notes, no computers or calculators of any kind. Name: RCS login: Circle your lab section: (01 MTh 10:00) (02 MTh 12:00) (03 MTh 2:00) (04 MTh 4:00) (05 MTh 6:00) (06 MTh 10:00) (07 TF 10:00) (08 TF 12:00) (09 MTh 12:00) (10 TF 2:00) (11 MTh 4:00) 1. Which is the more important advantage of vector over traditional arrays (1 point) A. A vector checks for an out of bounds index A B. A vector is not always passed by reference 2. Which is a bigger problem for vectors (1 point) A. If the program runs a long time it may have to use the garbage collector B. A vector is not always passed by reference A 3. Complete the following function to add a string to the end of a vector of strings (2 points). list.push_back (data); } 1 point for correct result
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
1 point for using push_back to add the item 4. Write a function to count how many times a given string is in a vector of strings. The
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

q7 sol - CSCI.1100 Computer Science I Quiz 7 November 2,...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online