1.

Which function is used to check whether a given sequence is heap or not?(a) sort_heap()(b) is_heap()(c) is_heap_until()(d) check_heap()The question was posed to me in semester exam.I need to ask this question from STL topic in division Class Hierarchies, Library & Containers of C++

Answer»

The CORRECT answer is (b) is_heap()

The best explanation: C++ STL-heap container provides is_heap() function to check whether a given SEQUENCE of elements represents a heap or not. Descending order of elements represents a valid heap.



Discussion

No Comment Found

Related InterviewSolutions