+1 vote
in Data Structures & Algorithms I by (88.2k points)
Min heap can be used to implement selection sort.

(a) True

(b) False

This key question is from Heap topic in chapter Heap of Data Structures & Algorithms I

This question was posed to me during an internship interview.

1 Answer

+1 vote
by (672k points)
selected by
Best 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.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.