Indicates that the results of the keyword 3,9,1,5 in the stretch tree in Figure 4-61 are accessed sequentially.
Figure 4-61
1. Principle
There are two main ways of rotation:
1) rotation of the sub-type
2) one-font rotation
The two approaches are actually a little different:
The sub-type rotation is a combination of two single rotations, and can be seen as the selection of the parent node of the target node (the following example illustrates)
The rotation of the grandparent node of the target node is followed by the rotation of the parent node (described in the following example).
Therefore, the standard AVL double rotation referred to in the book can be decomposed into two steps.
2. Exercise rotation steps:
1) 3-node access
First step: Node 3-2-4 Zigzag: Parent node rotation, so 2-1 rotation
The second step: this cannot be seen here as a 3-4-101 byte point, since the standard AVL rotation is rotated to two, so the second step of the previous 3-2-4 glyph is performed:
The 3 node's parent node 4 rotates.
The third step: only 3-10 nodes at this time, just rotate the parent node directly
2) 9-node access
First step: Connect the 9-8-61 font, after the standard AVL rotation:
Step Two: 9-4-10 zigzag standard AVL after rotation
The third step: only the parent node, no grandfather, the direct rotation of the parent node can be
3) 1-node access
First step: 1-2-31 font, after standard AVL rotation
Step Two: 1-9 only parent node, rotate parent node directly
4) 5-node access
First step: 5-6-81 glyphs, after dimensioning AVL rotation:
Step Two: 5-4-31 font, standard AVL after rotation
Step three: 5-2-9 zigzag, after standard AVL rotation:
Fourth step: 5-1, only the parent node
Data structure and algorithm analysis-C language description version Mark Allen Weiss