1.

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 IThe question was asked by my school teacher while I was bunking the class.

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.



Discussion

No Comment Found

Related InterviewSolutions