-
Notifications
You must be signed in to change notification settings - Fork 0
Tree
Tree can be used to implement the relationship between single data and multiple data in discrete mathematics.
Each trees have a couple of nodes, in which only one of them can be called "root". The relationship between two nodes is generally called parent and child (or father and son but may be considered as sexism). As the following diagram, "0" is the parent of "1" and "2" who are children of "0". In a tree, each nodes have parents except the "root".
0
| \
1 2
Besides, the nodes which don't have any children can be called leaves.
Binary tree, whose nodes have two children as most, is the most common category in trees.
Trees subject to some characters can be call full binary trees, perfect binary trees or complete binary trees: Nodes in full binary trees always have two children; perfect binary trees is a kind of full binary tree and their leaves have the same level; There are always full nodes in each level of complete trees.
Eular
- the height of a tree
- pre-order walk
- in-order walk
- post-order walk
- level-order walk