Q: How many sets of requirements are need in designing a container?
Solution: There are three sets of requirements. They are container interface requirements, Allocator interface requirements and iterator requirements.
Q: Which interface in the container is required for storage management?
Solution: Allocator interface in the container is required for storage management.
Q: Which is present in the basic interface of the allocator interface?
Solution: The basic interface of an allocator class consists of a set of typedefs, a pair of allocation functions, allocate() and deallocate() and a pair of construction/destruction members, construct() and destroy().
Q: Which is used for manually writing lookup table?
Solution: Lookup table means storing values in a table with unique keys for each value so that can be checked in future easily. So for such lookup tables maps are used in C++.
Q: How can the member functions in the container be accessed?
Solution: The container manages the storage space for its elements and provides member functions to access them, either directly or through iterators which reference objects with similar properties to pointers.
Q: Which of the following type does the container should define?
Solution: Every container must define an iterator type. Iterators allow algorithms to iterate over the container’s contents.
Q: Which are the parameters for the content of the buffer?
Solution: The contents of the buffer are initialized using the values from the iterator range supplied to the constructor by the start and finish parameters.
Q: What do vectors represent?
Solution: Vectors are sequence containers representing arrays that can change in size.
Q: In which type of storage location are the vector members stored?
Solution: Vectors use contiguous storage locations for their elements, which means that their elements can also be accessed using offsets on regular pointers to its elements
Q: How many vector container properties are there in c++?
Solution: There are three container properties in c++. They are sequence, Dynamic array and allocator-aware.
You Have Score    | /10 |