Test Series - cpp

Test Number 49/102

Q: What is the Standard Template Library?
A. Set of C++ template classes to provide common programming data structures and functions
B. Set of C++ classes
C. Set of Template functions used for easy data structures implementation
D. Set of Template data structures only
Solution: STL expanded as Standard Template Library is set of C++ template classes to provide common programming data structures and functions.
Q: Pick the correct statement.
A. STL is a generalized library
B. Components of STL are parameterized
C. STL uses the concept of templates classes and functions to achieve generalized implementation
D. All of the mentioned
Solution: STL is a generalized library and components of STL are parameterized. STL uses the concept of templates classes and function to achieve generalized implementation.
Q: How many components STL has?
A. 1
B. 2
C. 3
D. 4
Solution: STL has four components namely Algorithms, Containers, Functors and Iterators.
Q: What are the containers?
A. Containers store objects and data
B. Containers stores all the algorithms
C. Containers contain overloaded functions
D. Containers contain set of Iterators
Solution: Containers is a component of STL which stores objects and data.
Q: In how many categories, containers are divided?
A. 1
B. 2
C. 3
D. 4
Solution: Containers are divided into 4 categories namely Sequence Containers, Associative Containers, Unordered Associative Containers and Container Adaptors.
Q: What are the Sequence Containers?
A. Containers that implements data structures which can be accessed sequentially
B. Containers that implements sorted data structures for fast search in O(logn)
C. Containers that implements unsorted(hashed) data structures for quick search in O(1)
D. Containers that implements data structures which can be accessed non-sequentially
Solution: Sequence Containers is the subset of Containers that implements data structures which can be accessed sequentially.
Q: How many Sequence Containers are provided by C++?
A. 2
B. 3
C. 4
D. 5
Solution: C++ provides 5 types of Sequence Containers namely array, vector, deque, forward_list and list.
Q: What are the Associative Containers?
A. Containers that implements data structures which can be accessed sequentially
B. Containers that implements sorted data structures for fast search in O(logn)
C. Containers that implements unsorted(hashed) data structures for quick search in O(1)
D. Containers that implements data structures which can be accessed non-sequentially
Solution: Associative Containers is the subset of Containers that implements sorted data structures for fast search in O(logn).
Q: How many Associative Containers are provided by C++?
A. 2
B. 3
C. 4
D. 5
Solution: C++ provides 4 types of Associative Containers namely Set, Map, multiset and multimap.
Q: Which header file is used for Iterators?
A. 
B. 
C. 
D. 
Solution: Iterators are present inside the  header file so this header file is needed to use Iterators.

You Have Score    /10