数据结构三
2016-06-11 19:03:59 6 举报
AVL树实现插入运算
作者其他创作
大纲/内容
x LChild-Data
Height(AT-LChild) - Height(AT-RChild) == 2
No
Yes
AT = DoubleRotateWithLeft(AT)
x AT-RChild-Data
AT = SingleRotateWithRight(AT)
AT = SingleRotateWithLeft(AT)
AT-Data = x
AT==null
AT = (AVLTree)malloc(sizeof(AVLNode))
AT-Height = 0
AT = DoubleRotateWithRight(AT)
AT-RChild = NULL
AT-LChild = NULL
x Data
AT == NULL
Start
End
0 条评论
下一页