Ninth day (iii) learning data structure

  Then we look at how avl tree is rotated, how to traverse and other operations.

 

Why are more than two, and not have more than three, more than four of these operations it?

Since then cause an imbalance: is inserted or deleted, or the like. At that critical point, put it solves become balanced. After the two-time each occurrence, are dealt with

No cases have three or four layers of

 I can understand the four cases here, but I think things are:

 

 Actually, this is the situation as unbalanced as to why this is not?

the reason:

 

 For read operations after the rotation, in fact, if you know what I have that case, the meaning is: Y is empty, it is the same, just that it is empty it

For now or so, right right to know what it means.

Means: node causing the problem, starting from the root node way to turn in

 

 You know what it means right rotation: clockwise their roots, like a right turn as (or so it should be in order and the corresponding)

Then, then inherited the corresponding Y

 

 

 In this case, the situation is actually about

key: to start from the underlying implementation, the bottom is right, so we left rotation

Then look at this structure, the upper left becomes, so right rotation

He knows rotation should start from the bottom, and knows the circumstances under which corresponds to what the implementation of the rotation, and the rotation of the operation corresponding to know what is the next chapter to analyze the code

Objective To analyze the code is: know when to rotate.

Guess you like

Origin www.cnblogs.com/startFrom0/p/12638441.html