retagged by
164 views
0 votes
0 votes

Only build heap will not satisfy the given condition. I guess condition says that array should me halfway sorted ( a[i/2] <= a[i] ).

Using build heap only : 

But  array is not halway sorted so it still needs n/2logn time to do so. 

This is what i think.

Help in this.

retagged by

Please log in or register to answer this question.

Related questions

1 votes
1 votes
1 answer
2
iarnav asked Jun 21, 2018
474 views
In a binary Heap of 100 elements time taken to find the 99th element?or in a binary heap on "n" elements, time taken to find (n-1)th element? Note ; I'm not asking about ...
0 votes
0 votes
1 answer
3
syedasafoora asked Nov 8, 2023
251 views
Consider the following algorithm for Build-Max-heap and the given array A=[ 47,96, 35, 54, 77, 65, 83]. Run this algorithm on the given array and redraw the heap and the ...
1 votes
1 votes
1 answer
4