Concept
Heap is a complete and balanced binary tree.
Complete binary tree
All levels except possibly the last are completely full, and the last level has all its nodes to the left side.
Balanced binary tree
mod (Height(left subtree) – Height(right subtree) ) <= 1
Types
1 . Min heap
Each key < key of its children
Each key > key of its children
No comments:
Post a Comment