The nature of the binary tree:
Property 1. There are at most 2^ (i-1) nodes (I>=1) on the first layer of the binary tree.
Property 2. A two-fork tree with a depth of K contains up to 2^ (k)-1 nodes (k>=1).
Property 3. For any binary tree, if it contains n0 leaf nodes, N2 nodes with a degree of 2, there must be a relationship n0=n2+1.
Prove:
The total number of nodes on a two-fork tree is n, then n=n0+n1+n2, where N1 is a node with a degree of 1.
The total number of branches on the binary tree b=n1+2*n2;
and b=n-1 (because root node, each node has a point to its branch) =n0+n1+n2-1, thus, n0=n2+1;
Two types of special binary trees:
Full two fork tree: refers to a two-fork tree with a depth of K and contains 2^k-1 nodes.
Complete binary tree: The n nodes contained in the tree correspond to the numbers 1 to n one by one in the tree of two forks. (That is, a tree with a depth of K, its front k-1 layer is full, and the last layer of nodes is arranged from left to right).
Property 4.4. The depth of the complete binary tree of the European N nodes is logn+1.
Data structure Notes _ The nature of binary tree