1.

Consider the following heap after buildheap phase. What will be its corresponding array?(a) 26,53,41,97,58,59,31(b) 26,31,41,53,58,59,97(c) 26,41,53,97,31,58,59(d) 97,53,59,26,41,58,31I got this question during a job interview.This key question is from Heapsort in chapter Sorting of Data Structures & Algorithms II

Answer»

The CORRECT option is (d) 97,53,59,26,41,58,31

Easy EXPLANATION - Constructing a MAX heap USING the elements 97,53,59,26,41,58,31 will cause the heap to look like that.



Discussion

No Comment Found

Related InterviewSolutions