Learn by problem:
There are 18 nodes in a binary tree with a degree of 2, then the two fork tree has
Property 1:
The number of terminal nodes (leaf nodes) of a binary tree is equal to two branch nodes plus 1. Assuming that the terminal node in the binary tree is n0, the single branch node is N1, the double branch node is N2, the sum of the binary tree is n, because all nodes in the binary tree are less than or equal to 2, so there are: n=n0+n1+n2; On the other hand, The number of branches (that is, the degree) of all nodes in a binary tree should be equal to a single branch node plus twice double branch nodes, or n1+2xn2. By the nature of the tree 1, there are: n=n1+2xn2+1. According to the above two formulas, we can conclude that the following equation is established: n0+n1+n2= n1+2xn2+1 , so n0=n2+1.
The nodes with the degree of 0, 1 and 2 are x, Y, Z, and two forks are s=2z+y+1 or s=x+y+z, and the number of nodes is Z+1=x, which is 2 less than the leaf node tree.
Property 2:
2 of nodes are less 1,18+1=19 than leaf knot points
Two-fork Tree-node analysis