Update the symbols of the animations.

This commit is contained in:
krahets
2023-02-22 00:57:43 +08:00
parent 0b72fef381
commit 3daaf30f23
10 changed files with 89 additions and 89 deletions

View File

@ -313,16 +313,16 @@ AVL 树的独特之处在于「旋转 Rotation」的操作其可 **在不影
如下图所示(结点下方为「平衡因子」),从底至顶看,二叉树中首个失衡结点是 **结点 3**。我们聚焦在以该失衡结点为根结点的子树上,将该结点记为 `node` ,将其左子结点记为 `child` ,执行「右旋」操作。完成右旋后,该子树已经恢复平衡,并且仍然为二叉搜索树。
=== "Step 1"
=== "<1>"
![right_rotate_step1](avl_tree.assets/right_rotate_step1.png)
=== "Step 2"
=== "<2>"
![right_rotate_step2](avl_tree.assets/right_rotate_step2.png)
=== "Step 3"
=== "<3>"
![right_rotate_step3](avl_tree.assets/right_rotate_step3.png)
=== "Step 4"
=== "<4>"
![right_rotate_step4](avl_tree.assets/right_rotate_step4.png)
进而,如果结点 `child` 本身有右子结点(记为 `grandChild` ),则需要在「右旋」中添加一步:将 `grandChild` 作为 `node` 的左子结点。