refactor: Replace 结点 with 节点 (#452)

* Replace 结点 with 节点
Update the footnotes in the figures

* Update mindmap

* Reduce the size of the mindmap.png
This commit is contained in:
Yudong Jin
2023-04-09 04:32:17 +08:00
committed by GitHub
parent 3f4e32b2b0
commit 1c8b7ef559
395 changed files with 2056 additions and 2056 deletions
+12 -12
View File
@@ -14,8 +14,8 @@ import (
func TestAVLTree(t *testing.T) {
/* 初始化空 AVL 树 */
tree := newAVLTree()
/* 插入点 */
// 请关注插入点后,AVL 树是如何保持平衡的
/* 插入点 */
// 请关注插入点后,AVL 树是如何保持平衡的
testInsert(tree, 1)
testInsert(tree, 2)
testInsert(tree, 3)
@@ -27,28 +27,28 @@ func TestAVLTree(t *testing.T) {
testInsert(tree, 10)
testInsert(tree, 6)
/* 插入重复点 */
/* 插入重复点 */
testInsert(tree, 7)
/* 删除点 */
// 请关注删除点后,AVL 树是如何保持平衡的
testRemove(tree, 8) // 删除度为 0 的
testRemove(tree, 5) // 删除度为 1 的
testRemove(tree, 4) // 删除度为 2 的
/* 删除点 */
// 请关注删除点后,AVL 树是如何保持平衡的
testRemove(tree, 8) // 删除度为 0 的
testRemove(tree, 5) // 删除度为 1 的
testRemove(tree, 4) // 删除度为 2 的
/* 查询点 */
/* 查询点 */
node := tree.search(7)
fmt.Printf("\n查找到的点对象为 %#v 点值 = %d \n", node, node.Val)
fmt.Printf("\n查找到的点对象为 %#v 点值 = %d \n", node, node.Val)
}
func testInsert(tree *aVLTree, val int) {
tree.insert(val)
fmt.Printf("\n插入点 %d 后,AVL 树为 \n", val)
fmt.Printf("\n插入点 %d 后,AVL 树为 \n", val)
PrintTree(tree.root)
}
func testRemove(tree *aVLTree, val int) {
tree.remove(val)
fmt.Printf("\n删除点 %d 后,AVL 树为 \n", val)
fmt.Printf("\n删除点 %d 后,AVL 树为 \n", val)
PrintTree(tree.root)
}