Data structure - tree - Theory

1. is known a tree of depth k has a degree of node n1 is 1, n2 is the number of nodes 2, ..., a degree of NK nodes k and asked how many of the leaves of the tree Node?

(premise:

Any of a binary tree, the leaf nodes with homogeneous when n- 0 , the number of nodes of degree 2 is n- 2 , the n- 0 = n- 2 + 1'd. Certify as follows:

Provided on a binary tree leaf nodes with n- 0 , the branch nodes with a single n- . 1 , the bifurcation of nodes is n- 2 , is the summary of points: n- 0 + n- . 1 + n- 2 .

While a binary tree, the number of all branch nodes (i.e., degrees) should be equal to twice the single branch of the bifurcation of nodes plus the number of nodes, i.e., the total number of branches n-= . 1 + 2N 2 .

Because in addition to the binary tree root node, each node has only one branch to it, so a binary tree: the total number of branch points summarized = -1.

I.e. n- . 1 + 2N 2 = n- 0 + n- . 1 + n- 2 -1. I.e. n- 0 = n- 2 + 1'd. )

Oh is the multiplication sign

2. test all the different forms are shown having three binary tree nodes and nodes of the three.

 

Guess you like

Origin www.cnblogs.com/yundong333/p/11088269.html
Recommended