Monday, September 15, 2008

Full Binary Tree

The full binary tree question is really about the recursive theorem that we have practiced a lot in the course CSC148. Question is quite simple to answer. 

By using the complete induction, we first need to assume all the node n full binary trees have odd nubmer nodes. Since every internal node of a full binary tree have two nodes. We called them Left and Right respectively. 
Futhermore, as we assumed, the number of node for Left and Right is also odd for both of them. Thus, the total nodes for the full binary tree is simple, 1+L+R, where L and R are number of node for Left and Right subtree respectively. 
As we can see. the 1+L+R = 1+(L+R), since L+R is a even number. Then 1+L+R must be a odd number. Then we end the discussion for this full binary tree question. 

Actually before this lecture, I never think about the connection between recursion and complete induction. I think the more knowledge we got, the more connection we can find. All different course and material are actually connected each other.

1 comment:

Danny Heap said...

Recursion and induction are almost the same thing. We'll be proving recursive programs correct using induction.