Vidyalelo
C++ Programming · Q20

Standard Template Library (STL) in C++

Programming · C++ Programming · question 20

Q20

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

A.
To store elements in a sorted sequence with constant-time access to the largest element
B.
To store elements in a sorted sequence with constant-time access to the smallest element
C.
To store elements in a stack with constant-time access to the largest element
Answer
D.
To store elements in a queue with constant-time access to the largest element

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board