edited by
381 views
0 votes
0 votes
Consider the following max-heap as given below :
        
       9
   /      \
  6        8
 / \      / \
3  4     5  7

The number of swaps required to convert the given max-heap into min-heap is ______.
edited by

1 Answer

Best answer
2 votes
2 votes
I am getting as 5 swaps

9--6,9--3,8--5,6--3,6--4 swaps.Can you please help how to get 4
selected by
Answer:

Related questions

2 votes
2 votes
2 answers
2
Bikram asked May 26, 2017
375 views
Assume Dijkstra's Algorithm is used to find the shortest paths from node G in the above graph. The total number of edges which are not included in any of the shortest pat...
1 votes
1 votes
2 answers
3
Bikram asked May 26, 2017
496 views
The total number of LCS (Longest Common Subsequences) of $P = abcd123$ and $Q= badc321$ that can be formed are ______.
0 votes
0 votes
1 answer
4
Bikram asked May 26, 2017
338 views
Consider the following instance of the knapsack problem :$\begin{array}{|c|c|c|c|c|c|} \hline \text{Item} & a & b & c & d & e \\ \hline \text{Benefit} & 15 & 12 & 9 & 16 ...