129k views
3 votes
What is the difference between a minheap and a maxheap?

User FroMage
by
5.1k points

1 Answer

4 votes

Answer:

In the data structure, min heap uses the ascending priority method in which the small element is to be pop first from the heap. It basically define as root node is either equal to or less than to the child node in the heap method.

On the other hand, max heap use the descending priority method in which the large element pop first from the heap. In the max heap, the value in the root node is either equal to or greater to its child node.

User Monika Rani
by
5.2k points