+1 vote
in Data Structures & Algorithms I by (88.2k points)
What is the best case complexity in building a heap?

(a) O(nlogn)

(b) O(n^2)

(c) O(n*longn *logn)

(d) O(n)

Origin of the question is Binary Heap in portion Heap of Data Structures & Algorithms I

The question was asked by my school teacher while I was bunking the class.

1 Answer

+1 vote
by (672k points)
selected by
Best answer
The correct option is (d) O(n)

For explanation: The best case complexity occurs in bottom-up construction when we have a sortes array given.

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.