Self-test questions
For multiple choice questions, choose all the options that apply:
Which of the following are true for flat associative containers compared to ordered/unordered associative containers?
a. Require less memory
b. Insertion is faster
c. Traversal is slower
d. Lookups are faster
The
std::forward_list
does not provide asize()
member function because:a. Linear time size members cannot be supported for singly-linked lists
b. Both splice and size members cannot be constant time
c. It would be thread-unsafe
d. All of the above
Where is the internal memory of a
static_vector
allocated:a. Stack
b. Depends on where the static vector is created
c. Free store
d. Depends on the allocator used
In order to store objects of type X in an unordered container, which of the following must be defined/available for objects of type X?
a. Ordering relation
b. Hash function
c. Equality comparison
d. Copy constructor
Which data structure allows random access to its elements and supports iterators that are not invalidated...