CS253: Software Development with C++

Fall 2018

IQ 12

CS253 IQ 12

See this page as a slide show

Which has O(1) amortized insertion?

  1. array
  2. cache
  3. set
  4. string
  5. unordered_map

In which does 12 always appear before 34?

  1. deque<int>
  2. list<int>
  3. set<int>
  4. unordered_set<int>
  5. vector<int>

Which uses std::pair?

  1. array
  2. deque
  3. multimap
  4. string
  5. unordered_set

Which is correct?

  1. pair<int,double> p = {1,2.3}; cout << p[1];
  2. pair<int,double> p = {1,2.3}; cout << p<double>;
  3. pair<int,double> p = {1,2.3}; cout << p.double;
  4. pair<int,double> p = {1,2.3}; cout << p<second>;
  5. pair<int,double> p = {1,2.3}; cout << p.second;

Which is a valid λ-function declaration?

  1. auto lf = [](int n) -> int { return n*n; };
  2. auto lf = [](int n) { return n*n; };
  3. auto lf = [](int n) { return n*n; }
  4. auto lf = [](int n) { return n*n };

  1. 1
  2. 1 and 2
  3. 1, 2, and 3
  4. 1, 2, 3, and 4
  5. 2, 3, and 4

User: Guest

Check: HTML CSS
Edit History Source

Modified: 2018-07-01T15:08

Apply to CSU | Contact CSU | Disclaimer | Equal Opportunity
Colorado State University, Fort Collins, CO 80523 USA
© 2018 Colorado State University
CS Building