Data Structures | Heap | Question 1

Last Updated :
Discuss
Comments

What is the time complexity of Build Heap operation? 
(Build Heap is used to build a max(or min) binary heap from a given array. Build Heap is used in Heap Sort as a first step for sorting.)

O(nLogn)

O(n^2)

O(n)

O(logn)

Share your thoughts in the comments