An STL map stores elements as:
-
A
versions of the same object
-
B
key-value pairs sorted by key
Correct answer
-
C
a contiguous array of values
-
D
unique values sorted ascending
Correct answer
B. key-value pairs sorted by key
13 views
Explanation
std::map holds key-value pairs ordered by key, usually implemented as a balanced tree.
Reference
Asked in: NTS, PPSC IT, Campus Interviews
Doubts & discussion
Not sure why the answer is B? Ask here and get an explanation.
Ask a doubt about this MCQ