What is the tree in the computer?

Tree: a data structure noun.

1, the tree diagram is a data structure and consists of n (n >); = 1) Finite nodes form a set with hierarchical relationship. It is called a "tree" because it looks like an upside-down tree, that is, the roots are up and the leaves are down.

2. It has the following characteristics: each node has zero or more child nodes; Nodes without parent nodes are called root nodes; Each non-root node has one and only one parent node; Except the root node, each child node can be divided into multiple disjoint subtrees.

Extended data:

First, the type:

1, unordered tree: there is no order relationship between the children of any node in the tree. This kind of tree is called unordered tree, also called free tree.

2. Ordered tree: There is an ordered relationship between the children of any node in the tree, and this tree is called an ordered tree.

3. Binary tree: A tree with at most two subtrees at each node is called a binary tree.

4, complete binary tree, full binary tree.

5. Huffman tree: The binary tree with the shortest weighted path is called Huffman tree or optimal binary tree.

Second, the symbol expression:

1,no. First put the root node in a pair of brackets, and then put its subtree in brackets from left to right, and the subtree is treated in the same way.

2. The tree and its root node are enclosed in brackets, and the subtrees at the same level are separated by commas, and finally enclosed in brackets.

3. The tree can be expressed as: (1 (2 (5 (9, 10)), 3 (6,7) and 4(8)).

References:

Baidu Encyclopedia-Tree (data structure noun)