[Data Structure] I am doing the experience of the topic of the tree (constantly updated ...)

xiaoxiao2021-03-06  184

1. When the sequence is non-recursive traversed the bifurcation tree, the elements in the stack in the stack are accessed to the ancestors of this node.

2, the hierarchical sequence of the k-1 child of the K-tok tree P-node is p * k.

3. When the tree is written, the exit is often empty or sub-tree empty.

4, the binary tree turned into the binary tree.

5. In the structure of the child's brother, the node is not firstchild, the node must be a leaf in the structure of the tree. Therefore, the algorithm of the tree statistics with the child's brother chain can be written as firstchild == null.

6. Looking for future generations, it is often traversed, looking for ancestors.

7. Changes on the basis of accessing a binary tree according to the level, whether or not the left and right sub-trees are empty, if it is a full binary tree, it is output when it is outputted in the sequence, which is a continuous free null. The sequence, and the sequence contains an empty pointer.

8. Returning the value of RETURN to the upper function in recursive.

9. It is sufficient to retrieve a single tree, and do export judgments with NULL and non-NULL. For the worry of the building, return the address to the upper function with RETURN, and build a chain in a non-NULL state. For multiple trees, export judgment on different states of different trees.

10, preamble of the first neighborhood: When the node no left sub-tree, it is the node pointing to the LCHILD. Otherwise, a PRE pointer points to the root of the node, then the PRE pointer points to the current node Pre-drive. Backpoints: The node has a left subtree, then the left sub-tree is thereafter, otherwise the node pointing to its rchild.

11, the front drive of the neutral line tree: When the node no left sub-tree, its LCHILD pointing to the node is its pre-drive, otherwise it is the top right of the left sub-tree; successive: no node When the subtree, it will follow the node pointing to its rCHILD, otherwise it will follow the left node of its right child.

12, the front process of the rear sequence tree node: If the junction does not have the left sub-tree, the node that LCHILD points to the front drive is its predecessor, otherwise there is a right child, but the right child is driven to the front, otherwise its left child is Its pre-drive; successive node, the node right tree is empty, its rCHILD points to the nodes are followed, otherwise it is necessary to pass the parents of the node, if the junction is the left child of the parents, the parents have a right child. The end of the node is the leftmost node of its double pro-right child. If the double kind does not have the right man tree, it is a parent after the node. If the node is the right child of its parents, it is its parent. The linear bifurcation point is generally free of pointers pointing to the parents, which can be seen that the clues are not much more helpful to the rear sequence line tree.

13. For a given sequence building, apply a given sequence to find the position of its root, then find the upper and lower bounds of the left and right subtails as the top boundary of the new tree, constantly shrink the tree until the tree is empty.

14. To set the chain structure tree for a given static number, build the root first, then build the left and right bonus with the law of 2 * i and 2 * i 1.

15,

Constantly updated ...

转载请注明原文地址:https://www.9cbs.com/read-128549.html

New Post(0)