1.

Which function is used to insert an element into heap?(a) push_back()(b) push_heap()(c) pop_back()(d) pop_heap()This question was addressed to me in examination.This intriguing question originated from STL topic in division Class Hierarchies, Library & Containers of C++

Answer»

Correct choice is (b) push_heap()

The best explanation: C++ STL-heap container provides push_heap() FUNCTION that inserts a new ELEMENT to the CONSTRUCTED heap.



Discussion

No Comment Found

Related InterviewSolutions