This commit is contained in:
krahets
2023-09-17 01:11:45 +08:00
parent 8b99ac6930
commit 830dc9e326
15 changed files with 169 additions and 120 deletions

View File

@@ -3646,7 +3646,7 @@
<h1 id="75-avl">7.5 &nbsp; AVL 树 *<a class="headerlink" href="#75-avl" title="Permanent link">&para;</a></h1>
<p>在二叉搜索树章节中,我们提到了在多次插入和删除操作后,二叉搜索树可能退化为链表。这种情况下,所有操作的时间复杂度将从 <span class="arithmatex">\(O(\log n)\)</span> 恶化为 <span class="arithmatex">\(O(n)\)</span></p>
<p>在二叉搜索树章节中,我们提到了在多次插入和删除操作后,二叉搜索树可能退化为链表。这种情况下,所有操作的时间复杂度将从 <span class="arithmatex">\(O(\log n)\)</span> 恶化为 <span class="arithmatex">\(O(n)\)</span> </p>
<p>如图 7-24 所示,经过两次删除节点操作,这个二叉搜索树便会退化为链表。</p>
<p><img alt="AVL 树在删除节点后发生退化" src="../avl_tree.assets/avltree_degradation_from_removing_node.png" /></p>
<p align="center"> 图 7-24 &nbsp; AVL 树在删除节点后发生退化 </p>