1.

Elements in STL heap are removed in ________________________(a) decreasing order(b) increasing order(c) alternate i.e. once max element then min element(d) input orderI had been asked this question in an internship interview.Query is from STL topic in chapter Class Hierarchies, Library & Containers of C++

Answer»

Right choice is (a) decreasing order

Easy EXPLANATION - C++ STL-heap SIMULATES the MAX heap i.e. the maximum ELEMENT is at the top/front of the heap hence on poping we pop the first element which is always the maximum number in the sequence.



Discussion

No Comment Found

Related InterviewSolutions