mirror of
https://github.com/krahets/hello-algo.git
synced 2025-12-16 03:59:18 +08:00
Several bug fixes and improvements. (#887)
* fix the bugs of C code. * Add a header figure. * Improve the definition of tree node height.
This commit is contained in:
@@ -207,7 +207,7 @@ AVL 树既是二叉搜索树也是平衡二叉树,同时满足这两类二叉
|
||||
|
||||
```
|
||||
|
||||
“节点高度”是指从该节点到最远叶节点的距离,即所经过的“边”的数量。需要特别注意的是,叶节点的高度为 0 ,而空节点的高度为 -1 。我们将创建两个工具函数,分别用于获取和更新节点的高度。
|
||||
“节点高度”是指从该节点到其最远叶节点的距离,即所经过的“边”的数量。需要特别注意的是,叶节点的高度为 0 ,而空节点的高度为 -1 。我们将创建两个工具函数,分别用于获取和更新节点的高度。
|
||||
|
||||
```src
|
||||
[file]{avl_tree}-[class]{a_v_l_tree}-[func]{update_height}
|
||||
|
||||
@@ -200,7 +200,7 @@
|
||||
- 节点的「度 degree」:节点的子节点的数量。在二叉树中,度的取值范围是 0、1、2 。
|
||||
- 二叉树的「高度 height」:从根节点到最远叶节点所经过的边的数量。
|
||||
- 节点的「深度 depth」:从根节点到该节点所经过的边的数量。
|
||||
- 节点的「高度 height」:从最远叶节点到该节点所经过的边的数量。
|
||||
- 节点的「高度 height」:从距离该节点最远的叶节点到该节点所经过的边的数量。
|
||||
|
||||

|
||||
|
||||
|
||||
Reference in New Issue
Block a user