CS253 IQ 12
Show Main.IQ12 as a slide show.
Which has O(1) amortized insertion at the end?
array
cache
set
string
unordered_map
In which does 12
always appear before 34
?
deque<int>
list<int>
set<int>
unordered_set<int>
vector<int>
A set<int>
is sorted by numeric value.
Which uses std::pair
?
array
deque
multimap
string
unordered_set
map
and multimap
have key,value pairs.
Which is correct?
pair<int,double> p = {1,2.3}; cout << p[1];
pair<int,double> p = {1,2.3}; cout << p<double>;
pair<int,double> p = {1,2.3}; cout << p.double;
pair<int,double> p = {1,2.3}; cout << p<second>;
pair<int,double> p = {1,2.3}; cout << p.second;
E
Which is a valid λ-function declaration?
-
auto lf = [](int n) -> int { return n*n; };
auto lf = [](int n) { return n*n; };
auto lf = [](int n) { return n*n; }
auto lf = [](int n) { return n*n };
- 1
- 1 and 2
- 1, 2, and 3
- 1, 2, 3, and 4
- 2, 3, and 4
B: 1 & 2 are the same. 3 & 4 are missing semicolons.