1.

Which container is used to keep priority based elements?(a) queue(b) stack(c) set(d) priority queueI got this question by my school teacher while I was bunking the class.Query is from More Containers in portion Class Hierarchies, Library & Containers of C++

Answer»

Right option is (d) priority queue

For explanation: C++ provides priority queue container that stores elements BASED on their priority. For EXAMPLE, if the ABSOLUTE value is the priority then -6 will be kept before 4 in the priority queue.



Discussion

No Comment Found

Related InterviewSolutions