## Heapify(): maintain the heap property

- Given: a node i in the heap with children l and r
- Given: two subtrees rooted at l and r, assumed to be heaps
- Problem: The subtree rooted at i may violate the heap property (How?)
- Action: let the value of the parent node “float down” so subtree at i satisfies the heap property
- What do you suppose will be the basic operation between i, l, and r?

Previous slide | Next slide | Back to first slide | View graphic version |