Defined:
Tree:
A tree is a finite set t of N (n≥0) nodes, and when n>0 meets the following conditions:
(1) There is only one specific node called root (Root);
(2) When n>1, the remaining nodes can be divided into m (m>0) disjoint finite set T1, T2 、...、 Tm, each set Ti (1≤i≤m) is a tree, and is called the subtree of the tree T (subtree).
In particular, a tree that does not contain any nodes (that is, n=0) is called an empty tree.
Here is the structure of a tree:
- Ordered tree: If the subtree of each node in the tree is considered to be sequential from left to right (that is, it cannot be interchanged), the tree is called an ordered tree
- Unordered tree: If the subtree of each node in the tree is considered to be left-to-right (that is, interchangeable), the tree is called an unordered tree
Two-fork Tree:
A binary tree is an ordered tree with a maximum of two children per node and a sub-tree with left and right points
Classical algorithm (v) binary tree & Balance binary tree & red and black tree