Basic Operations on Min Heap

Following are the basic operations that are performed on the min heap:

  • extractMax(): To get the maximum value and remove it from the heap.
  • insert(): insert a new item in the heap.

C Program to Implement Max Heap

In this article, we will learn the implementation of the max heap in the C programming language.

A heap is a data structure like a tree with some special properties. The basic requirement of the heap is that the value of a node must be greater than equal to (or smaller than equal to) the value of its children and the tree should be a complete binary tree.

Similar Reads

What is Max Heap?

The max-heap is the heap where each and every node of a complete binary tree is greater than or equal to its child node. We can see the example of a max-heap in the below image....

Basic Operations on Min Heap

Following are the basic operations that are performed on the min heap:...

Implementation of the Max Heap in C

To implement the max heap, we will use the structures in C to implement the heap data structure to write the implementation of the max heap to maintain the property of the max heap we have used the bottom-up and top-down approaches both. Let’s understand some important functions of the max heap program....