An array of integers of size n can be converted into a heap by adjusting the heaps rooted at each internal node of the complete binary tree starting at the node ⌊(n - 1) /2⌋, and doing this adjustment up to the root node (root node is at index 0) in the order ⌊(n - 1)/2⌋, ⌊(n - 3)/ 2⌋, ....., 0. The time required to construct a heap in this manner is
- O(log n)
- O(n)
- O (n log log n)
- O(n log n)
I dont get what question meant
can ny implemented on following array
1,2,3,4,5 ?