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:
Recursion and induction are almost the same thing. We'll be proving recursive programs correct using induction.
Post a Comment