Reference blog:
79343914
Common properties of one or two-fork tree
<1> there are up to 2 I-1 nodes on the first layer of a binary tree. (i>=1)
<2>. Two if the depth is K (with K-layer) in the tree, then there are at most 2k-1 nodes. (k>=1)
<3> If the binary tree is numbered from the top to the bottom from left to right, then if a node is numbered K, then the node numbers of the two branches are 2k and 2k+1 respectively.
<4> two fork tree Category: full two fork tree, complete binary tree
<5> In a fully binary tree, the depth of a full binary tree with n nodes is [log2n]+1, where [log2n]+1 is rounded down. The depth of the two-fork tree is k=log2 (n+1);
Full two fork tree: height is h, and a two-fork tree consisting of 2^h-1 nodes is called a full two-fork tree.
Three ways to traverse a two or two-fork tree
(1) Sequence traversal: root node--left dial hand tree, right subtree
(2) Middle sequence traversal: the right subtree, the root node, left dial hand tree
(3) post-post traversal: root node, right subtree, left dial hand tree
The principle of getting the traversal order is to iterate through the method recursively
Binary Tree of data structure