# lec20a - Binary Tree Properties Representation Minimum...

This preview shows pages 1–8. Sign up to view the full content.

Binary Tree Properties & Representation

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Minimum Number Of Nodes Minimum number of nodes in a binary tree whose height is h . At least one node at each of first h levels. minimum number of nodes is h
Maximum Number Of Nodes All possible nodes at first h levels are present. Maximum number of nodes = 1 + 2 + 4 + 8 + … + 2 h-1 = 2 h - 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Let n be the number of nodes in a binary tree whose height is h . h <= n <= 2 h – 1 log 2 (n+1) <= h <= n
Full Binary Tree A full binary tree of a given height h has 2 h – 1 nodes. Height 4 full binary tree.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Numbering Nodes In A Full Binary Tree Number the nodes 1 through 2 h – 1 . Number by levels from top to bottom. Within a level number from left to right. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Parent of node i is node i / 2 , unless i = 1 . Node 1 is the root and has no parent. 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 21

lec20a - Binary Tree Properties Representation Minimum...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online