The one or two-forked tree (Binary) is a finite set of n (n>=0) nodes, the collection is either an empty set (called a null binary tree) or a two-fork tree of a root node and two disjoint Saozi, called root nodes, respectively. As shown in Figure 1 is a tree with two forks
Figure 1
The characteristics of the binary tree:
(1) Each node has a maximum of two Shang trees, so there is no node with a degree greater than 2 in the binary tree.
(2) Saozi the right subtree is ordered, the order cannot be reversed.
(3) Even if a node in the tree has only one Shang tree, it is also to distinguish whether it is a Zuozi or a right subtree.
The binary tree has five basic forms:
(1) an empty binary tree; (2) Only one root node, (3) the root node is only Zuozi, (4) The root node is only the right subtree, (5) The root node has both Zuozi and right subtree.
Two, special two fork Tree
1, Oblique tree: All the nodes are only Zuozi two fork tree is called Left oblique tree. All nodes are only the right subtree of the two-tree called the right oblique tree.
2, full two fork tree: In a binary tree, if all branch nodes exist Saozi right subtree, and all leaves are on the same layer, such a two-fork tree is called full two fork tree, such as Figure 2.
Figure 2
The characteristics of two fork trees are:
(1) The leaves can only be present at the bottom of the floor. It is impossible to strike a balance in other layers.
(2) The degree of non-leaf node must be 2.
(3) In the same depth of the two-fork tree, the number of nodes with two fork trees is the most, and the most leaves tree.