389 views

1 Answer

Best answer
1 votes
1 votes

First of all in the question it should be " 4 ary heap not 4 array heap "..Having said that ,

In the 0th level , index of element = 1

In the 1st level , index of next 4 elements = 2 , 3 , 4 , 5

In the 2nd level , index of next 16 elements  =  6 , 7 ,..,10,11.....,14,15,.......,18,19,20, 21

So clearly parent of element indexed 15  =  4

Hence the required answer is 4.

selected by

Related questions

0 votes
0 votes
1 answer
1
syedasafoora asked Nov 8, 2023
249 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 ...