Binary Tree

Left Child

Right child

Parent

Degree: number of children (0,1,2)

Leaf node: (degree of 0)

Internal Node: (degree > 0)

Depth of a node = distance from a root.

Height = maximum distance from the node to a leaf

Height of the tree = height of the root

A complete tree of height h has…

  • 1 node at depth 0

  • 2 nodes at depth 1

  • 4 nodes at depth 2

  • 2^h nodes at depth h

The total number of nodes of a complete tree of height h is 2^(h+1) -1