1.

Min heap can be used to implement selection sort.(a) True(b) FalseThis key question is from Heap topic in chapter Heap of Data Structures & Algorithms IThis question was posed to me during an internship interview.

Answer»

Right option is (a) True

To explain: In MIN heap, the insertion and deletion operation takes O(LOGN) time. Therefore, a selection SORT with n INSERTIONS and n DELETIONS can be implemented using a min heap in O(nlogn) operations.



Discussion

No Comment Found

Related InterviewSolutions