0

How would i go about proving the relationship with j and k if T is a binary tree with k internal vertices and j terminal vertices

In a full binary tee I know that j = k + 1

In a binary tree that is not full I know that j = k if there are an odd number of vertices with one child and j = k - 1 if there are an even number of vertices with one child.

I am not sure how to go about the proving process though.

Lrrr
  • 4,755
  • 5
  • 41
  • 63
User9193
  • 57
  • 1
  • 11

1 Answers1

0

The total number of nodes in a complete binary tree of depth d equals 2(d+1) – 1. Since all leaves in such a tree are at level d, the tree contains 2d leaves and, therefore, 2d - 1 internal nodes. and you can use this to prove the other one.

Lrrr
  • 4,755
  • 5
  • 41
  • 63