Standard Template Library

1.Which of the following is NOT a part of the C++ Standard Template Library (STL)?
  • A. Vector
  • B. List
  • C. Queue
  • D. Map

Queue

Queue

2.Which container in C++ STL allows random access to elements?
  • A. List
  • B. Set
  • C. Vector
  • D. Map

Vector

Vector

3.Which container class in C++ STL is implemented as a doubly linked list?
  • A. Vector
  • B. Map
  • C. List
  • D. Set

List

List

4.In C++ STL, the map container stores its elements in which data structure?
  • A. Array
  • B. Linked List
  • C. Binary Search Tree (usually Red-Black Tree)
  • D. Hash Table

Binary Search Tree (usually Red-Black Tree)

Binary Search Tree (usually Red-Black Tree)

5. Which function is used to remove all elements from a vector in C++ STL?
  • A. clear()
  • B. erase()
  • C. delete()
  • D. reset()

clear()

clear()