Help me understanding Heapify method

Anybody please help me understanding Minheapify method from this link .I am not getting what is actually going on there.And please mention some question on heaps if you remember.

What we are doing is recursively doing,the following steps:

  1. Get the index of the smallest element out of three --> the root, the left child and the right child…
    If the smallest index is the root then return…
  2. Else wise swap the root with the lowest element and now rrecursively call heapify for the next level with index (treated as root in the next call) as the index :slight_smile:
    Upvote
1 Like

Wow…thanks :slight_smile: please give me some questions if you remember :slight_smile:

See questions on this site at the bottom… Graph theory is the place (and sorting for higher number of elements with no extra space is an advantage of heaps)
https://github.com/yanhan/competitive-programming/tree/master/minmaxheap