lec20a - Binary Tree Properties Representation Minimum...

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

View Full Document Right Arrow Icon
Binary Tree Properties & Representation
Background image of page 1

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

View Full Document Right Arrow Icon
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
Background image of page 2
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
Background image of page 3

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

View Full Document Right Arrow Icon
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
Background image of page 4
Full Binary Tree A full binary tree of a given height h has 2 h – 1 nodes. Height 4 full binary tree.
Background image of page 5

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

View Full Document Right Arrow Icon
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
Background image of page 6
Parent of node i is node i / 2 , unless i = 1 . Node 1 is the root and has no parent. 1
Background image of page 7

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

View Full Document Right Arrow Icon
Image of page 8
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 Right Arrow Icon
Ask a homework question - tutors are online