mirror of
https://github.com/charlienet/go-mixed.git
synced 2025-07-18 00:22:41 +08:00
update
This commit is contained in:
25
tree/avl_tree.go
Normal file
25
tree/avl_tree.go
Normal file
@ -0,0 +1,25 @@
|
||||
package tree
|
||||
|
||||
type avlTree struct {
|
||||
}
|
||||
|
||||
func NewAVLTree() {
|
||||
|
||||
}
|
||||
|
||||
// 左单旋,新插入的节点在右子树的右侧
|
||||
func (t *avlTree) rotateL() {
|
||||
|
||||
}
|
||||
|
||||
// 右单旋,新插入的节点在左子树的左侧
|
||||
func (t *avlTree) rotateR() {
|
||||
|
||||
}
|
||||
|
||||
// 右左双旋,新插入的节点在右子树的左侧
|
||||
// 1. 先对subR进行一个右单旋
|
||||
// 2. 再对parent进行一个左单旋然后修改平衡因子
|
||||
func (t *avlTree) rotateRL() {
|
||||
|
||||
}
|
Reference in New Issue
Block a user