mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-29 21:33:07 +08:00
deploy
This commit is contained in:
@ -60,7 +60,18 @@
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
<link href="../../assets/stylesheets/glightbox.min.css" rel="stylesheet"/><style>
|
||||
html.glightbox-open { overflow: initial; height: 100%; }
|
||||
.gslide-title { margin-top: 0px; user-select: text; }
|
||||
.gslide-desc { color: #666; user-select: text; }
|
||||
.gslide-image img { background: white; }
|
||||
|
||||
.gscrollbar-fixer { padding-right: 15px; }
|
||||
.gdesc-inner { font-size: 0.75rem; }
|
||||
body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);}
|
||||
body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);}
|
||||
body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}
|
||||
</style> <script src="../../assets/javascripts/glightbox.min.js"></script></head>
|
||||
|
||||
|
||||
|
||||
@ -1972,14 +1983,6 @@
|
||||
10.2 二分查找插入点
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="md-status md-status--new" title="最近添加">
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
@ -2000,14 +2003,6 @@
|
||||
10.3 二分查找边界
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="md-status md-status--new" title="最近添加">
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
@ -2427,14 +2422,6 @@
|
||||
第 12 章 分治
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="md-status md-status--new" title="最近添加">
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
|
||||
@ -2466,14 +2453,6 @@
|
||||
12.1 分治算法
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="md-status md-status--new" title="最近添加">
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
@ -2494,14 +2473,6 @@
|
||||
12.2 分治搜索策略
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="md-status md-status--new" title="最近添加">
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
@ -2522,14 +2493,6 @@
|
||||
12.3 构建树问题
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="md-status md-status--new" title="最近添加">
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
@ -2550,14 +2513,6 @@
|
||||
12.4 汉诺塔问题
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="md-status md-status--new" title="最近添加">
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
@ -2578,14 +2533,6 @@
|
||||
12.5 小结
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="md-status md-status--new" title="最近添加">
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
@ -2817,14 +2764,6 @@
|
||||
第 14 章 动态规划
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="md-status md-status--new" title="最近添加">
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
|
||||
@ -2856,14 +2795,6 @@
|
||||
14.1 初探动态规划
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="md-status md-status--new" title="最近添加">
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
@ -2884,14 +2815,6 @@
|
||||
14.2 DP 问题特性
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="md-status md-status--new" title="最近添加">
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
@ -2912,14 +2835,6 @@
|
||||
14.3 DP 解题思路
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="md-status md-status--new" title="最近添加">
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
@ -2940,14 +2855,6 @@
|
||||
14.4 0-1 背包问题
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="md-status md-status--new" title="最近添加">
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
@ -2968,14 +2875,6 @@
|
||||
14.5 完全背包问题
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="md-status md-status--new" title="最近添加">
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
@ -2996,14 +2895,6 @@
|
||||
14.6 编辑距离问题
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="md-status md-status--new" title="最近添加">
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
@ -3024,14 +2915,6 @@
|
||||
14.7 小结
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="md-status md-status--new" title="最近添加">
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
@ -3090,14 +2973,6 @@
|
||||
第 15 章 贪心
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="md-status md-status--new" title="最近添加">
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
|
||||
@ -3129,14 +3004,6 @@
|
||||
15.1 贪心算法
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="md-status md-status--new" title="最近添加">
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
@ -3157,14 +3024,6 @@
|
||||
15.2 分数背包问题
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="md-status md-status--new" title="最近添加">
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
@ -3185,14 +3044,6 @@
|
||||
15.3 最大容量问题
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="md-status md-status--new" title="最近添加">
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
@ -3213,14 +3064,6 @@
|
||||
15.4 最大切分乘积问题
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="md-status md-status--new" title="最近添加">
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
@ -3241,14 +3084,6 @@
|
||||
15.5 小结
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="md-status md-status--new" title="最近添加">
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
@ -3561,7 +3396,7 @@
|
||||
<li>「大顶堆 max heap」:任意节点的值 <span class="arithmatex">\(\geq\)</span> 其子节点的值。</li>
|
||||
<li>「小顶堆 min heap」:任意节点的值 <span class="arithmatex">\(\leq\)</span> 其子节点的值。</li>
|
||||
</ul>
|
||||
<p><img alt="小顶堆与大顶堆" src="../heap.assets/min_heap_and_max_heap.png" /></p>
|
||||
<p><a class="glightbox" href="../heap.assets/min_heap_and_max_heap.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="小顶堆与大顶堆" src="../heap.assets/min_heap_and_max_heap.png" /></a></p>
|
||||
<p align="center"> 图 8-1 小顶堆与大顶堆 </p>
|
||||
|
||||
<p>堆作为完全二叉树的一个特例,具有以下特性。</p>
|
||||
@ -3879,7 +3714,7 @@
|
||||
<p>我们在二叉树章节中学习到,完全二叉树非常适合用数组来表示。由于堆正是一种完全二叉树,<strong>我们将采用数组来存储堆</strong>。</p>
|
||||
<p>当使用数组表示二叉树时,元素代表节点值,索引代表节点在二叉树中的位置。<strong>节点指针通过索引映射公式来实现</strong>。</p>
|
||||
<p>如图 8-2 所示,给定索引 <span class="arithmatex">\(i\)</span> ,其左子节点索引为 <span class="arithmatex">\(2i + 1\)</span> ,右子节点索引为 <span class="arithmatex">\(2i + 2\)</span> ,父节点索引为 <span class="arithmatex">\((i - 1) / 2\)</span>(向下取整)。当索引越界时,表示空节点或节点不存在。</p>
|
||||
<p><img alt="堆的表示与存储" src="../heap.assets/representation_of_heap.png" /></p>
|
||||
<p><a class="glightbox" href="../heap.assets/representation_of_heap.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="堆的表示与存储" src="../heap.assets/representation_of_heap.png" /></a></p>
|
||||
<p align="center"> 图 8-2 堆的表示与存储 </p>
|
||||
|
||||
<p>我们可以将索引映射公式封装成函数,方便后续使用。</p>
|
||||
@ -4185,31 +4020,31 @@
|
||||
<div class="tabbed-set tabbed-alternate" data-tabs="4:9"><input checked="checked" id="__tabbed_4_1" name="__tabbed_4" type="radio" /><input id="__tabbed_4_2" name="__tabbed_4" type="radio" /><input id="__tabbed_4_3" name="__tabbed_4" type="radio" /><input id="__tabbed_4_4" name="__tabbed_4" type="radio" /><input id="__tabbed_4_5" name="__tabbed_4" type="radio" /><input id="__tabbed_4_6" name="__tabbed_4" type="radio" /><input id="__tabbed_4_7" name="__tabbed_4" type="radio" /><input id="__tabbed_4_8" name="__tabbed_4" type="radio" /><input id="__tabbed_4_9" name="__tabbed_4" type="radio" /><div class="tabbed-labels"><label for="__tabbed_4_1"><1></label><label for="__tabbed_4_2"><2></label><label for="__tabbed_4_3"><3></label><label for="__tabbed_4_4"><4></label><label for="__tabbed_4_5"><5></label><label for="__tabbed_4_6"><6></label><label for="__tabbed_4_7"><7></label><label for="__tabbed_4_8"><8></label><label for="__tabbed_4_9"><9></label></div>
|
||||
<div class="tabbed-content">
|
||||
<div class="tabbed-block">
|
||||
<p><img alt="元素入堆步骤" src="../heap.assets/heap_push_step1.png" /></p>
|
||||
<p><a class="glightbox" href="../heap.assets/heap_push_step1.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="元素入堆步骤" src="../heap.assets/heap_push_step1.png" /></a></p>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<p><img alt="heap_push_step2" src="../heap.assets/heap_push_step2.png" /></p>
|
||||
<p><a class="glightbox" href="../heap.assets/heap_push_step2.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="heap_push_step2" src="../heap.assets/heap_push_step2.png" /></a></p>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<p><img alt="heap_push_step3" src="../heap.assets/heap_push_step3.png" /></p>
|
||||
<p><a class="glightbox" href="../heap.assets/heap_push_step3.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="heap_push_step3" src="../heap.assets/heap_push_step3.png" /></a></p>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<p><img alt="heap_push_step4" src="../heap.assets/heap_push_step4.png" /></p>
|
||||
<p><a class="glightbox" href="../heap.assets/heap_push_step4.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="heap_push_step4" src="../heap.assets/heap_push_step4.png" /></a></p>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<p><img alt="heap_push_step5" src="../heap.assets/heap_push_step5.png" /></p>
|
||||
<p><a class="glightbox" href="../heap.assets/heap_push_step5.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="heap_push_step5" src="../heap.assets/heap_push_step5.png" /></a></p>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<p><img alt="heap_push_step6" src="../heap.assets/heap_push_step6.png" /></p>
|
||||
<p><a class="glightbox" href="../heap.assets/heap_push_step6.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="heap_push_step6" src="../heap.assets/heap_push_step6.png" /></a></p>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<p><img alt="heap_push_step7" src="../heap.assets/heap_push_step7.png" /></p>
|
||||
<p><a class="glightbox" href="../heap.assets/heap_push_step7.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="heap_push_step7" src="../heap.assets/heap_push_step7.png" /></a></p>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<p><img alt="heap_push_step8" src="../heap.assets/heap_push_step8.png" /></p>
|
||||
<p><a class="glightbox" href="../heap.assets/heap_push_step8.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="heap_push_step8" src="../heap.assets/heap_push_step8.png" /></a></p>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<p><img alt="heap_push_step9" src="../heap.assets/heap_push_step9.png" /></p>
|
||||
<p><a class="glightbox" href="../heap.assets/heap_push_step9.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="heap_push_step9" src="../heap.assets/heap_push_step9.png" /></a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -4543,34 +4378,34 @@
|
||||
<div class="tabbed-set tabbed-alternate" data-tabs="6:10"><input checked="checked" id="__tabbed_6_1" name="__tabbed_6" type="radio" /><input id="__tabbed_6_2" name="__tabbed_6" type="radio" /><input id="__tabbed_6_3" name="__tabbed_6" type="radio" /><input id="__tabbed_6_4" name="__tabbed_6" type="radio" /><input id="__tabbed_6_5" name="__tabbed_6" type="radio" /><input id="__tabbed_6_6" name="__tabbed_6" type="radio" /><input id="__tabbed_6_7" name="__tabbed_6" type="radio" /><input id="__tabbed_6_8" name="__tabbed_6" type="radio" /><input id="__tabbed_6_9" name="__tabbed_6" type="radio" /><input id="__tabbed_6_10" name="__tabbed_6" type="radio" /><div class="tabbed-labels"><label for="__tabbed_6_1"><1></label><label for="__tabbed_6_2"><2></label><label for="__tabbed_6_3"><3></label><label for="__tabbed_6_4"><4></label><label for="__tabbed_6_5"><5></label><label for="__tabbed_6_6"><6></label><label for="__tabbed_6_7"><7></label><label for="__tabbed_6_8"><8></label><label for="__tabbed_6_9"><9></label><label for="__tabbed_6_10"><10></label></div>
|
||||
<div class="tabbed-content">
|
||||
<div class="tabbed-block">
|
||||
<p><img alt="堆顶元素出堆步骤" src="../heap.assets/heap_pop_step1.png" /></p>
|
||||
<p><a class="glightbox" href="../heap.assets/heap_pop_step1.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="堆顶元素出堆步骤" src="../heap.assets/heap_pop_step1.png" /></a></p>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<p><img alt="heap_pop_step2" src="../heap.assets/heap_pop_step2.png" /></p>
|
||||
<p><a class="glightbox" href="../heap.assets/heap_pop_step2.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="heap_pop_step2" src="../heap.assets/heap_pop_step2.png" /></a></p>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<p><img alt="heap_pop_step3" src="../heap.assets/heap_pop_step3.png" /></p>
|
||||
<p><a class="glightbox" href="../heap.assets/heap_pop_step3.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="heap_pop_step3" src="../heap.assets/heap_pop_step3.png" /></a></p>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<p><img alt="heap_pop_step4" src="../heap.assets/heap_pop_step4.png" /></p>
|
||||
<p><a class="glightbox" href="../heap.assets/heap_pop_step4.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="heap_pop_step4" src="../heap.assets/heap_pop_step4.png" /></a></p>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<p><img alt="heap_pop_step5" src="../heap.assets/heap_pop_step5.png" /></p>
|
||||
<p><a class="glightbox" href="../heap.assets/heap_pop_step5.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="heap_pop_step5" src="../heap.assets/heap_pop_step5.png" /></a></p>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<p><img alt="heap_pop_step6" src="../heap.assets/heap_pop_step6.png" /></p>
|
||||
<p><a class="glightbox" href="../heap.assets/heap_pop_step6.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="heap_pop_step6" src="../heap.assets/heap_pop_step6.png" /></a></p>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<p><img alt="heap_pop_step7" src="../heap.assets/heap_pop_step7.png" /></p>
|
||||
<p><a class="glightbox" href="../heap.assets/heap_pop_step7.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="heap_pop_step7" src="../heap.assets/heap_pop_step7.png" /></a></p>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<p><img alt="heap_pop_step8" src="../heap.assets/heap_pop_step8.png" /></p>
|
||||
<p><a class="glightbox" href="../heap.assets/heap_pop_step8.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="heap_pop_step8" src="../heap.assets/heap_pop_step8.png" /></a></p>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<p><img alt="heap_pop_step9" src="../heap.assets/heap_pop_step9.png" /></p>
|
||||
<p><a class="glightbox" href="../heap.assets/heap_pop_step9.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="heap_pop_step9" src="../heap.assets/heap_pop_step9.png" /></a></p>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<p><img alt="heap_pop_step10" src="../heap.assets/heap_pop_step10.png" /></p>
|
||||
<p><a class="glightbox" href="../heap.assets/heap_pop_step10.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="heap_pop_step10" src="../heap.assets/heap_pop_step10.png" /></a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -5197,10 +5032,15 @@ aria-label="页脚"
|
||||
<div class="md-copyright">
|
||||
|
||||
<div class="md-copyright__highlight">
|
||||
Copyright © 2023 Krahets
|
||||
Copyright © 2022 - 2023 Krahets
|
||||
</div>
|
||||
|
||||
|
||||
Made with
|
||||
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
|
||||
Material for MkDocs
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Social links -->
|
||||
@ -5269,5 +5109,5 @@ aria-label="页脚"
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
<script>document$.subscribe(() => {const lightbox = GLightbox({"touchNavigation": true, "loop": false, "zoomable": true, "draggable": false, "openEffect": "zoom", "closeEffect": "zoom", "slideEffect": "none"});})</script></body>
|
||||
</html>
|
Reference in New Issue
Block a user