retagged by
448 views
0 votes
0 votes

Consider the following array of elements

$<70, 23, 60, 19, 13, 16, 1, 4, 8, 12, 7, 10, 85>$

The minimum number of interchanges needed to convert into a max-heap is 

  1. $4$
  2. $1$
  3. $3$
  4. $2$
retagged by

1 Answer

2 votes
2 votes
Answer C 3
It requires 3 interchange because only one node 85 insert at last create problem so
first interchange with 16 
Second with 60 and finally exchange with 70 
To perform these interchange we apply max heapify operation

 

edited by
Answer:

Related questions

0 votes
0 votes
1 answer
1
admin asked Jan 5, 2019
375 views
Match all items in $\text{Group 1}$ with the $\textbf{best}$ match from the options given in $\text{Group 2}.$$$\begin{array}{|l|l|} \hline \qquad \quad \textbf{Group 1} ...