1,065 views
0 votes
0 votes

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

  1. O(log n)
  2. O(n)
  3. O (n log log n)
  4. O(n log n)

I dont get what question meant

can ny implemented on following array

1,2,3,4,5 ?

1 Answer

Related questions

2 votes
2 votes
1 answer
1
Thor-o-s asked Sep 1, 2022
411 views
Can anyone please explain how to find “ i “ smallest elements from an array whose elements are distinctPlease use max heap to explain the working input : n distinct e...
0 votes
0 votes
1 answer
2
2 votes
2 votes
1 answer
3
Nandkishor3939 asked Jan 15, 2019
3,322 views
I was going through the heap concept and one question came into my mind what will be the best case time complexity of finding the minimum element in a max heap?Thank you:...
0 votes
0 votes
1 answer
4
saurav raghaw asked Dec 22, 2018
685 views
The time complexity of the most efficient algorithm to determine whether an arbitrary array of size ‘n’, is min-heap or not?(A) O(log n)(B) O(n)(C) O(n logn)(D) O(1)