Which standard container provides average constant-time lookup by key?
Correct answer A. std::unordered_map
Subject / 929 questions
Page 8 of Programming multiple-choice questions with answers. Tap an option to check yourself.
Page 8 of 47
Correct answer A. std::unordered_map
Correct answer B. Compilation fails because functions cannot be overloaded on return type alone
Correct answer A. GC
Correct answer A. 5
Correct answer A. So that deleting a derived object through a base pointer runs the derived destructor
Correct answer A. ?: (conditional operator)
Correct answer A. IDI
Correct answer C. 11 1
Correct answer C. int* const p = &x;
Correct answer C. <iostream>
Correct answer D. Internal linkage, so they are visible only in that translation unit
Correct answer A. C 67
Correct answer A. std::string
Correct answer D. Compilation fails because T is deduced as both int and double
Correct answer B. Yes; a temporary is created and its lifetime is extended to match r
Correct answer C. AB
Correct answer D. 15
Correct answer D. All of them are invalidated
Correct answer B. virtual void draw() = 0;
Correct answer C. 1221