The multi-level directory structure of the file system is a tree structure. (Recommended learning: Web front -end video tutorial )
tree structure is a one -level nested structure. The outer and inner layers of a tree structure have similar structures, so this structure can often be represented recursively.
Various tree diagrams in classic data structures are a typical tree structure: a tree can be simply represented as a root, a left subtree, and a right subtree. The left subtree and the right subtree have their own subtrees.
Tree structure refers to a data structure in which there is a "one-to-many" tree relationship between data elements. It is an important type of nonlinear data structure.
In the tree structure, the root node has no predecessor node, and each of the other nodes has only one predecessor node. Leaf nodes have no subsequent nodes, and the number of subsequent nodes for each remaining node can be one or multiple.
In addition, the tree structure in mathematical statistics can represent hierarchical relationships.
Tree structures are also used in many other aspects. Can express subordination and parallel relationships.
Terms
1. Node (Node): represents the data element in the tree, consisting of the relationship between data items and data elements.
2. Degree of Node: the number of subtrees owned by the node.
3. Degree of Tree: the maximum value of the degree of each node in the tree.
4. Leaf Node: A node with degree 0, also called a terminal node.
5. Branch Node: A node with a degree other than 0, also called a non-terminal node or an internal node.
6. Child: the root of the node subtree.
7. Parent: The upper node of a node is called the parent of the node.
8. Ancestor: All nodes on the branches from the root to the node.
9. Descendant: Any node in the subtree rooted at a certain node.
10. Brother: Children of the same parents.
11. Level of Node: The number of branches on the path from the root node to a node in the tree is called the level of the node. The level of the root node is set to 1, and the levels of other nodes are equal to the levels of their parent nodes plus 1.
12. Cousin (Sibling): Nodes with different parents on the same level.
13. Depth of Tree: The maximum number of levels of nodes in the tree.
14. Unordered Tree: The order between the child nodes of any node in the tree constitutes a tree that does not matter. Usually a tree refers to an unordered tree.
15. Ordered Tree: A tree in which the child nodes of any node in the tree have a strict order. A binary tree is an ordered tree because each child node in the binary tree is exactly defined as whether it is the left child node or the right child node of the node.
16. Forest: a collection of m (m≥0) trees. The concepts of trees and forests in nature are very different, but in data structures, the concepts of trees and forests are very different. It can be seen from the definition that a tree consists of a root node and m sub-trees. If the root node of the tree is deleted, the tree becomes a forest containing m trees. Of course, by definition, a tree can also be called a forest.
The above is the detailed content of Is the multi-level directory structure of the file system a tree structure?. For more information, please follow other related articles on the PHP Chinese website!