mirror of
https://github.com/krahets/hello-algo.git
synced 2024-12-26 02:06:30 +08:00
deploy
This commit is contained in:
parent
53b74526f2
commit
0b39d71e58
5 changed files with 56 additions and 78 deletions
|
@ -1622,7 +1622,7 @@
|
|||
<li>两个不同的 key 经过哈希函数可能得到相同的桶索引,进而发生哈希冲突,导致查询错误。</li>
|
||||
<li>缓解哈希冲突的途径有两种:哈希表扩容、优化哈希表的表示方式。</li>
|
||||
<li>负载因子定义为哈希表中元素数量除以桶槽数量,体现哈希冲突的严重程度,常用作哈希表扩容的触发条件。与数组扩容的原理类似,哈希表扩容操作开销也很大。</li>
|
||||
<li>链式地址考虑将单个元素转化成一个链表,将所有冲突元素都存储在一个链表中,从而解决哈希冲突。而为了提升查询效率,可以把链表转化为 AVL 树或红黑树,</li>
|
||||
<li>链式地址考虑将单个元素转化成一个链表,将所有冲突元素都存储在一个链表中,从而解决哈希冲突。链表过长会导致查询效率变低,可以通过把链表转化为 AVL 树或红黑树来解决。</li>
|
||||
<li>开放寻址通过多次探测来解决哈希冲突。线性探测使用固定步长,缺点是不能删除元素且容易产生聚集。多次哈希使用多个哈希函数进行探测,相对线性探测不容易产生聚集,代价是多个哈希函数增加了计算量。</li>
|
||||
<li>在工业界中,Java 的 HashMap 采用链式地址、Python 的 Dict 采用开放寻址。</li>
|
||||
</ul>
|
||||
|
|
30
index.html
30
index.html
|
@ -74,11 +74,6 @@
|
|||
<label class="md-overlay" for="__drawer"></label>
|
||||
<div data-md-component="skip">
|
||||
|
||||
|
||||
<a href="#_1" class="md-skip">
|
||||
跳转至
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div data-md-component="announce">
|
||||
|
||||
|
@ -1578,21 +1573,6 @@
|
|||
|
||||
|
||||
|
||||
<label class="md-nav__title" for="__toc">
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
目录
|
||||
</label>
|
||||
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#_1" class="md-nav__link">
|
||||
作者简介
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1615,8 +1595,6 @@
|
|||
|
||||
|
||||
|
||||
<h1>Home</h1>
|
||||
|
||||
<div class="tabbed-set tabbed-alternate" data-tabs="1:1"><input checked="checked" id="__tabbed_1_1" name="__tabbed_1" type="radio" /><div class="tabbed-labels"><label for="__tabbed_1_1"> </label></div>
|
||||
<div class="tabbed-content">
|
||||
<div class="tabbed-block">
|
||||
|
@ -1666,10 +1644,10 @@
|
|||
|
||||
<p>近两年来,我在力扣上分享了一些题解和算法文章,回复了许多读者的评论问题,遇到最多的一类问题则是“如何入门学习算法”。我逐渐也对这个问题好奇了起来。</p>
|
||||
<p>两眼一抹黑地刷题应该是最受欢迎的方式。刷题就如同玩“扫雷”游戏一样,基础好的同学可以顺利地将地雷逐个排掉,而基础不足的同学很可能被炸的满头是包,并在受挫中渐渐退缩。通读教材书籍也是常用方法,但对于面向求职的同学来说,毕业季、投递简历、应付笔面试已经占用大部分精力,厚重的书本也因此成为巨大的挑战。</p>
|
||||
<p>如果你也有上述烦恼,那么很幸运这本书找到了你。本书是我对于该问题给出的答案,虽然不一定正确,但至少代表一次积极的尝试。这本书虽然不足以让你直接拿到 Offer ,但可以带领你探索出算法知识的“地图”,让你了解不同“地雷”的形状大小和分布位置,并使你掌握各种“排雷方法”。</p>
|
||||
<p>本书提供可一键运行的源代码,已被翻译至 12 种编程语言,托管在 <a href="https://github.com/krahets/hello-algo">github.com/krahets/hello-algo</a> 仓库。发行版 PDF 的更新周期较长,想看最新内容的小伙伴可以前往 <a href="https://www.hello-algo.com/">www.hello-algo.com</a> 网页版。</p>
|
||||
<p>希望这本书能够帮助你把知识的“雪球”滚起来,让你做到心中有数、不慌不忙。加油!</p>
|
||||
<h3 id="_1">作者简介<a class="headerlink" href="#_1" title="Permanent link">¶</a></h3>
|
||||
<p>如果你也有上述烦恼,那么很幸运这本书找到了你。本书是我对于该问题给出的答案,虽然不一定正确,但至少代表一次积极的尝试。这本书虽然不足以让你直接拿到 Offer ,但会引导你探索数据结构与算法的“知识地图”,带你了解不同“地雷”的形状大小和分布位置,让你掌握各种“排雷方法”。有了这些本领,相信你可以更加得心应手地开展算法学习,逐步搭建起完整的知识体系。</p>
|
||||
<p>本书提供可一键运行的源代码,已被翻译至十余种编程语言,托管在 <a href="https://github.com/krahets/hello-algo">github.com/krahets/hello-algo</a> 仓库。发行版 PDF 的更新周期较长,想看最新内容的小伙伴可以前往 <a href="https://www.hello-algo.com/">www.hello-algo.com</a> 网页版。</p>
|
||||
<h3 align="left"> 作者简介 </h3>
|
||||
|
||||
<p>靳宇栋 (Krahets),大厂高级算法工程师,上海交通大学硕士。力扣(LeetCode)全网阅读量最高博主,其 LeetBook《图解算法数据结构》已被订阅 22 万本。</p>
|
||||
<hr />
|
||||
<h2 align="center"> 致谢 </h2>
|
||||
|
|
File diff suppressed because one or more lines are too long
100
sitemap.xml
100
sitemap.xml
|
@ -2,252 +2,252 @@
|
|||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_appendix/contribution/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_appendix/installation/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_array_and_linkedlist/array/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_array_and_linkedlist/linked_list/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_array_and_linkedlist/list/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_array_and_linkedlist/summary/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_computational_complexity/performance_evaluation/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_computational_complexity/space_complexity/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_computational_complexity/space_time_tradeoff/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_computational_complexity/summary/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_computational_complexity/time_complexity/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_data_structure/classification_of_data_structure/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_data_structure/data_and_memory/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_data_structure/summary/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_graph/graph/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_graph/graph_operations/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_graph/graph_traversal/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_graph/summary/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_hashing/hash_collision/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_hashing/hash_map/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_hashing/summary/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_heap/build_heap/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_heap/heap/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_heap/summary/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_introduction/algorithms_are_everywhere/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_introduction/summary/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_introduction/what_is_dsa/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_preface/about_the_book/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_preface/suggestions/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_reference/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_searching/binary_search/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_searching/hashing_search/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_searching/linear_search/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_searching/summary/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_sorting/bubble_sort/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_sorting/insertion_sort/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_sorting/intro_to_sort/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_sorting/merge_sort/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_sorting/quick_sort/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_sorting/summary/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_stack_and_queue/deque/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_stack_and_queue/queue/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_stack_and_queue/stack/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_stack_and_queue/summary/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_tree/avl_tree/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_tree/binary_search_tree/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_tree/binary_tree/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_tree/binary_tree_traversal/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.hello-algo.com/chapter_tree/summary/</loc>
|
||||
<lastmod>2023-02-28</lastmod>
|
||||
<lastmod>2023-03-01</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
</urlset>
|
BIN
sitemap.xml.gz
BIN
sitemap.xml.gz
Binary file not shown.
Loading…
Reference in a new issue