[Data Structure] Nonlinear Structure – Tree (Basic Concept)

The standard definition of a tree: a finite set containing n (n>0) nodes.

1. Each element in the set is called a node (Node)

2. There is a special node called Root

3. The node elements other than the root node are divided into m (m>=0) disjoint sets, each of which is also a tree itself, called the subtree of the root node.

The basic concept of tree definition:

1. Each node has only one parent node (except the root node) and n (n>=0) child nodes

2. A node without a parent node is called the root node

3. The number of subtrees in a node is called the degree of the node

4. A node with a degree of 0 is called a leaf node (Leaf)

5. Non-leaf nodes are called branch nodes

6. If a node contains one or more child nodes, it is called the parent node or parent node of one or more nodes

7. The root node of the subtree contained in a node is called the child node of the node

8. Nodes with the same parent node are called sibling nodes

9. The root node level is the first level, and the level of other nodes is based on the +1 operation of the parent node, until it is added to the leaf node. The maximum level of all nodes on a tree is called the depth or height of the tree

10. The value of the maximum degree of a node in a tree is called the degree of the tree.

11. A collection of m disjoint trees is called a forest

Leave a Comment

Your email address will not be published.