What is the best case complexity in building a heap?

Category: QuestionsWhat is the best case complexity in building a heap?
Editor">Editor Staff asked 5 months ago

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 Answers
Editor">Editor Staff answered 5 months ago

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.


Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17
Articles: 40701