Vidyalelo
C++ Programming · all questions

Standard Template Library (STL) in C++
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

109

Questions

1/6

Page

Pick an option on a question to see the right answer and solution.

Which header file is used to include the vector container in C++ STL?

Select an option to see the answer and solution.

What does STL stand for in C++?

Select an option to see the answer and solution.

What is the purpose of the 'std::sort' function in C++ STL?

Select an option to see the answer and solution.

Which container in C++ STL does not allow duplicate elements?

Select an option to see the answer and solution.

What is the time complexity of accessing an element in a vector in C++ STL?

Select an option to see the answer and solution.

Which algorithm in C++ STL is used to find the maximum element in a range?

Select an option to see the answer and solution.

What is the purpose of the 'std::map' container in C++ STL?

Select an option to see the answer and solution.

Which container in C++ STL is implemented as a doubly linked list?

Select an option to see the answer and solution.

What is the purpose of the 'std::set' container in C++ STL?

Select an option to see the answer and solution.

What does the 'std::reverse' algorithm do in C++ STL?

Select an option to see the answer and solution.

Which container in C++ STL does not preserve the order of elements?

Select an option to see the answer and solution.

What is the time complexity of searching for an element in a set in C++ STL?

Select an option to see the answer and solution.

Which algorithm in C++ STL is used to merge two sorted ranges into a single sorted range?

Select an option to see the answer and solution.

What is the purpose of the 'std::unordered_map' container in C++ STL?

Select an option to see the answer and solution.

Which algorithm in C++ STL is used to remove all occurrences of a value from a container?

Select an option to see the answer and solution.

What is the purpose of the 'std::deque' container in C++ STL?

Select an option to see the answer and solution.

Which algorithm in C++ STL is used to count the number of occurrences of a value in a range?

Select an option to see the answer and solution.

What is the time complexity of inserting an element into a set in C++ STL?

Select an option to see the answer and solution.

Which container in C++ STL is typically implemented using a red-black tree?

Select an option to see the answer and solution.

What is the purpose of the 'std::priority_queue' container in C++ STL?

Select an option to see the answer and solution.