answersLogoWhite

0

What is the algorithm of minimum heapify?

Updated: 12/13/2022
User Avatar

Abidkhan

Lvl 1
11y ago

Best Answer

MIN_HEAPIFY(A,i)

{

l=LEFT(i);//calculates the left childs location

r=RIGHT(i);//right childs location

if((l<=A.heap_size)&&(A[l]<A[i]))

small=l;

else

small=i;

if((r<=A.heapsize)&&(A[small]>A[r]))

small=r;

if(small!=i)

{

exchange A[i] with A[small];

MIN_HEAPIFY

}

}

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the algorithm of minimum heapify?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

When is minimum mean square error algorithm used?

This type of algorithm is commonly used in n dimensional clustering applications. This mean is commonly the simplest to use and a typical algorithm employing the minimum square error algorithm can be found in McQueen 1967.


What is krushkal algorithm?

Kruskal's algorithm is an algorithm in graph theory that finds a minimum spanning tree for a connected weighted graph. This means it finds a subset of the edges that forms a tree that includes every vertex, where the total weight of all the edges in the tree is minimized. If the graph is not connected, then it finds a minimum spanning forest (a minimum spanning tree for each connected component). Kruskal's algorithm is an example of a greedy algorithm.


What is a c-code to implement heapsort?

Heapsort(A) { BuildHeap(A) for i &lt;- length(A) downto 2 { exchange A[1] &lt;-&gt; A[i] heapsize &lt;- heapsize -1 Heapify(A, 1) } BuildHeap(A) { heapsize &lt;- length(A) for i &lt;- floor( length/2 ) downto 1 Heapify(A, i) } Heapify(A, i) { le &lt;- left(i) ri &lt;- right(i) if (le&lt;=heapsize) and (A[le]&gt;A[i]) largest &lt;- le else largest &lt;- i if (ri&lt;=heapsize) and (A[ri]&gt;A[largest]) largest &lt;- ri if (largest != i) { exchange A[i] &lt;-&gt; A[largest] Heapify(A, largest) } }


What is cost optimal algorithm in parallel computing?

The cost optimal algorithm in parallel computing is the modular structured parallel algorithm that satisfy the insatiable demand of low power consumption, reduces speed and minimum silicon area.


Can dijkstra's algorithm produce a spanning tree?

yes, but a shortest path tree, not a minimum spanning tree

Related questions

When is minimum mean square error algorithm used?

This type of algorithm is commonly used in n dimensional clustering applications. This mean is commonly the simplest to use and a typical algorithm employing the minimum square error algorithm can be found in McQueen 1967.


What is krushkal algorithm?

Kruskal's algorithm is an algorithm in graph theory that finds a minimum spanning tree for a connected weighted graph. This means it finds a subset of the edges that forms a tree that includes every vertex, where the total weight of all the edges in the tree is minimized. If the graph is not connected, then it finds a minimum spanning forest (a minimum spanning tree for each connected component). Kruskal's algorithm is an example of a greedy algorithm.


What is a c-code to implement heapsort?

Heapsort(A) { BuildHeap(A) for i &lt;- length(A) downto 2 { exchange A[1] &lt;-&gt; A[i] heapsize &lt;- heapsize -1 Heapify(A, 1) } BuildHeap(A) { heapsize &lt;- length(A) for i &lt;- floor( length/2 ) downto 1 Heapify(A, i) } Heapify(A, i) { le &lt;- left(i) ri &lt;- right(i) if (le&lt;=heapsize) and (A[le]&gt;A[i]) largest &lt;- le else largest &lt;- i if (ri&lt;=heapsize) and (A[ri]&gt;A[largest]) largest &lt;- ri if (largest != i) { exchange A[i] &lt;-&gt; A[largest] Heapify(A, largest) } }


What is cost optimal algorithm in parallel computing?

The cost optimal algorithm in parallel computing is the modular structured parallel algorithm that satisfy the insatiable demand of low power consumption, reduces speed and minimum silicon area.


Who is the inventor of Reverse Delete Algorithm for MST When was this first published?

The Reverse Delete Algorithm for finding the Minimum Spanning Tree was first introduced by Edsger Dijkstra in 1959. He presented this algorithm in his paper titled &quot;A note on two problems in connexion with graphs&quot; which was published in Numerische Mathematik.


Can dijkstra's algorithm produce a spanning tree?

yes, but a shortest path tree, not a minimum spanning tree


What is the complexity of kruskal's minimum spanning tree algorithm on a graph with n nodes and e edges?

o(eloge)


What is the usefulness of minimum moment algorithm in resource levelling?

resource leveling is an effective means of smoothing the utilization of resources


How do you calculate the minimum bounding box of a convex polygon?

With the two rotating calipers algorithm: http://cgm.cs.mcgill.ca/~orm/rotcal.html


What has the author Ahmad Rana written?

Ahmad Rana has written: 'Minimum time motion planning of the RTX robot using an evolutionary algorithm'


How do you find minimum number amongst 100 numbers Write step by step procedure?

one method is to use MS Excel .but i am interested in the algorithm or steps involved to determine th minimum or maximum that is the science working behind it.


How are the expanded algorithm and the standard algorithm different?

They are different because standard algorithm is more common then the expanded algorithm