2023-02-08 15:20:18 +08:00
---
comments: true
2023-09-23 04:53:37 +08:00
glightbox: false
2023-02-08 15:20:18 +08:00
hide:
- footer
---
2023-06-18 03:47:36 +08:00
< h1 align = "center" > < / h1 >
2023-02-08 15:20:18 +08:00
2023-06-18 03:47:36 +08:00
< p align = "center" >
2023-11-09 05:13:48 +08:00
< img src = "index.assets/conceptual_rendering.png" width = "200" >
< img src = "index.assets/hello_algo_mindmap_tp.png" width = "320" >
2023-06-18 03:47:36 +08:00
< / p >
< h2 align = "center" > 《 Hello 算法 》< / h2 >
2023-06-22 00:22:53 +08:00
< p align = "center" > 动画图解、一键运行的数据结构与算法教程 < / p >
2023-06-18 03:47:36 +08:00
< p align = "center" >
< a href = "https://github.com/krahets/hello-algo" >
2023-11-04 04:16:59 +08:00
< img alt = "GitHub repo stars" src = "https://img.shields.io/github/stars/krahets/hello-algo?style=social&link=https%3A%2F%2Fgithub.com%2Fkrahets%2Fhello-algo" >
< / a >
< a href = "https://github.com/krahets/hello-algo/releases" >
2023-11-04 04:47:17 +08:00
< img alt = "GitHub all releases" src = "https://img.shields.io/github/downloads/krahets/hello-algo/total?style=social&logo=gitbook&logoColor=black&label=Downloads" >
2023-06-18 03:47:36 +08:00
< / a >
2023-07-01 03:04:02 +08:00
< a href = "https://github.com/krahets/hello-algo" >
2023-10-10 22:59:09 +08:00
< img alt = "GitHub contributors" src = "https://img.shields.io/github/contributors-anon/krahets/hello-algo?style=social&logo=git&logoColor=%23101010" >
2023-06-18 03:47:36 +08:00
< / a >
< / p >
2023-02-08 15:20:18 +08:00
2023-11-04 04:16:59 +08:00
< p align = "center" >
< img src = "https://img.shields.io/badge/Python-snow?logo=python&logoColor=3776AB" >
< img src = "https://img.shields.io/badge/C%2B%2B-snow?logo=c%2B%2B&logoColor=00599C" >
< img src = "https://img.shields.io/badge/Java-snow?logo=coffeescript&logoColor=FC4C02" >
< img src = "https://img.shields.io/badge/C%23-snow?logo=csharp&logoColor=512BD4" >
< img src = "https://img.shields.io/badge/Go-snow?logo=go&logoColor=00ADD8" >
< img src = "https://img.shields.io/badge/Swift-snow?logo=swift&logoColor=F05138" >
< img src = "https://img.shields.io/badge/JavaScript-snow?logo=javascript&logoColor=E9CE30" >
< img src = "https://img.shields.io/badge/TypeScript-snow?logo=typescript&logoColor=3178C6" >
< img src = "https://img.shields.io/badge/Dart-snow?logo=dart&logoColor=0175C2" >
< img src = "https://img.shields.io/badge/Rust-snow?logo=rust&logoColor=000000" >
< img src = "https://img.shields.io/badge/C-snow?logo=c&logoColor=A8B9CC" >
< img src = "https://img.shields.io/badge/Zig-snow?logo=zig&logoColor=F7A41D" >
< img src = "https://img.shields.io/badge/Stay%20Tuned-snow" >
< / p >
2023-02-08 15:20:18 +08:00
---
2023-03-06 22:40:50 +08:00
< h2 align = "center" > 推荐语 < / h2 >
!!! quote
2023-12-02 06:24:05 +08:00
“一本通俗易懂的数据结构与算法入门书,引导读者手脑并用地学习,强烈推荐算法初学者阅读!”
2023-03-06 22:40:50 +08:00
** —— 邓俊辉,清华大学计算机系教授**
!!! quote
“如果我当年学数据结构与算法的时候有《Hello 算法》,学起来应该会简单 10 倍!”
** —— 李沐,亚马逊资深首席科学家**
---
2023-06-18 03:47:36 +08:00
< h3 align = "center" > 全书动画图解 < / h3 >
2023-02-08 15:20:18 +08:00
2023-02-13 17:30:55 +08:00
< p align = "center" > 内容清晰易懂、学习曲线平滑< / br > 电脑、平板、手机全终端阅读 < / p >
2023-02-08 15:20:18 +08:00
2023-12-04 02:54:01 +08:00
< img src = "index.assets/animation_light.gif" class = "cover-image" style = "width: 100%; border-radius: 0.5rem;" >
2023-02-08 15:20:18 +08:00
!!! quote ""
< p align = "center" > "A picture is worth a thousand words." < / p >
< p align = "center" > “一图胜千言” < / p >
---
2023-06-18 03:47:36 +08:00
< h3 align = "center" > 代码一键运行 < / h3 >
2023-02-08 15:20:18 +08:00
2023-11-04 05:01:01 +08:00
< p align = "center" > 提供各个算法与数据结构的简洁实现与测试样例,皆可直接运行< / br > 支持 Python、C++、Java、C#、Go、Swift、JS、TS、Dart、Rust、C、Zig 等语言 < / p >
2023-02-08 15:20:18 +08:00
2023-12-04 02:54:01 +08:00
< img src = "index.assets/running_code_light.gif" class = "cover-image" style = "width: 100%; border-radius: 0.5rem;" >
2023-02-08 15:20:18 +08:00
!!! quote ""
< p align = "center" > "Talk is cheap. Show me the code." < / p >
< p align = "center" > “少吹牛,看代码” < / p >
---
2023-06-18 03:47:36 +08:00
< h3 align = "center" > 可讨论与提问 < / h3 >
2023-02-08 15:20:18 +08:00
2023-02-13 17:30:55 +08:00
< p align = "center" > 鼓励小伙伴们互帮互助、共同成长< / br > 提问与评论一般能在两日内得到回复 < / p >
2023-02-08 15:20:18 +08:00
2023-12-04 02:54:01 +08:00
< img src = "index.assets/comment_light.gif" class = "cover-image" style = "width: 100%; border-radius: 0.5rem;" >
2023-02-08 15:20:18 +08:00
!!! quote ""
< p align = "center" > “追风赶月莫停留,平芜尽处是春山” < / p >
< p align = "center" > 一起加油! < / p >
---
2023-03-01 00:24:32 +08:00
< h2 align = "center" > 序 < / h2 >
2023-02-08 15:20:18 +08:00
2023-12-02 06:24:05 +08:00
两年前,我在力扣上分享了“剑指 Offer”系列题解, 受到了许多同学的喜爱和支持。在与读者交流期间, 我最常收到的一个问题是“如何入门算法”。逐渐地, 我对这个问题产生了浓厚的兴趣。
2023-02-13 16:26:27 +08:00
2023-12-02 06:24:05 +08:00
两眼一抹黑地刷题似乎是最受欢迎的方法,简单直接且有效。然而刷题就如同玩“扫雷”游戏,自学能力强的同学能够顺利将地雷逐个排掉,而基础不足的同学很可能被炸的满头是包,并在挫折中步步退缩。通读教材也是一种常见做法,但对于面向求职的同学来说,毕业季、投递简历、准备笔试面试已经消耗了大部分精力,啃厚重的书往往变成了一项艰巨的挑战。
2023-02-13 16:26:27 +08:00
2023-12-02 06:24:05 +08:00
如果你也面临类似的困扰,那么很幸运这本书找到了你。本书是我对这个问题给出的答案,即使不是最优解,也至少是一次积极的尝试。本书虽然不足以让你直接拿到 Offer ,但会引导你探索数据结构与算法的“知识地图”,带你了解不同“地雷”的形状、大小和分布位置,让你掌握各种“排雷方法”。有了这些本领,相信你可以更加自如地刷题和阅读文献,逐步构建起完整的知识体系。
2023-02-08 15:20:18 +08:00
2023-12-02 06:24:05 +08:00
我深深赞同费曼教授所言: “Knowledge isn't free. You have to pay attention.”从这个意义上看,这本书并非完全“免费”。为了不辜负你为本书所付出的宝贵“注意力”,我会尽我所能,投入最大的“注意力”来完成这本书的创作。
2023-11-03 17:59:34 +08:00
2023-03-01 16:55:43 +08:00
< h3 align = "left" > 作者简介 < / h3 >
2023-03-01 00:24:32 +08:00
2023-09-27 13:46:51 +08:00
靳宇栋 ([Krahets](https://leetcode.cn/u/jyd/)), 大厂高级算法工程师, 上海交通大学硕士。力扣( LeetCode) 全网阅读量最高博主, 发表的[《图解算法数据结构》](https://leetcode.cn/leetbook/detail/illustration-of-algorithm/)已被订阅 27 万本。
2023-02-08 15:20:18 +08:00
2023-02-26 05:34:43 +08:00
---
< h2 align = "center" > 致谢 < / h2 >
2023-02-08 15:20:18 +08:00
2023-12-02 06:24:05 +08:00
本书在开源社区众多贡献者的共同努力下不断完善。感谢每一位投入时间与精力的撰稿人,他们是(按照 GitHub 自动生成的顺序排列):
2023-02-08 15:20:18 +08:00
< p align = "center" >
< a href = "https://github.com/krahets/hello-algo/graphs/contributors" >
2023-02-13 17:30:55 +08:00
< img width = "550" src = "https://contrib.rocks/image?repo=krahets/hello-algo" / >
2023-02-08 15:20:18 +08:00
< / a >
< / p >
2023-12-02 06:24:05 +08:00
本书的代码审阅工作由 Gonglja、gvenusleo、hpstory、justin‐ tse、krahets、night-cruise、nuomi1、Reanon 和 sjinzh 完成(按照首字母顺序排列)。感谢他们付出的时间与精力,正是他们确保了各语言代码的规范与统一。
2023-02-09 19:44:54 +08:00
< div class = "center-table" >
< table >
< tbody >
2023-09-14 03:34:29 +08:00
< td align = "center" > < a href = "https://github.com/Gonglja" > < img style = "border-radius: 50%;" src = "https://avatars.githubusercontent.com/u/39959756?v=4" width = "50px;" alt = "Gonglja" / > < br / > < sub > < b > Gonglja< / b > < / sub > < / a > < br / > < sub > C, C++< / sub > < / td >
< td align = "center" > < a href = "https://github.com/gvenusleo" > < img style = "border-radius: 50%;" src = "https://avatars.githubusercontent.com/u/79075347?v=4" width = "50px;" alt = "gvenusleo" / > < br / > < sub > < b > gvenusleo< / b > < / sub > < / a > < br / > < sub > Dart< / sub > < / td >
< td align = "center" > < a href = "https://github.com/hpstory" > < img style = "border-radius: 50%;" src = "https://avatars.githubusercontent.com/u/33348162?v=4" width = "50px;" alt = "hpstory" / > < br / > < sub > < b > hpstory< / b > < / sub > < / a > < br / > < sub > C#< / sub > < / td >
< td align = "center" > < a href = "https://github.com/justin-tse" > < img style = "border-radius: 50%;" src = "https://avatars.githubusercontent.com/u/24556310?v=4" width = "50px;" alt = "justin-tse" / > < br / > < sub > < b > justin-tse< / b > < / sub > < / a > < br / > < sub > JS, TS< / sub > < / td >
< td align = "center" > < a href = "https://github.com/krahets" > < img style = "border-radius: 50%;" src = "https://avatars.githubusercontent.com/u/26993056?v=4" width = "50px;" alt = "krahets" / > < br / > < sub > < b > krahets< / b > < / sub > < / a > < br / > < sub > Java, Python< / sub > < / td >
< td align = "center" > < a href = "https://github.com/night-cruise" > < img style = "border-radius: 50%;" src = "https://avatars.githubusercontent.com/u/77157236?v=4" width = "50px;" alt = "night-cruise" / > < br / > < sub > < b > night-cruise< / b > < / sub > < / a > < br / > < sub > Rust< / sub > < / td >
< td align = "center" > < a href = "https://github.com/nuomi1" > < img style = "border-radius: 50%;" src = "https://avatars.githubusercontent.com/u/3739017?v=4" width = "50px;" alt = "nuomi1" / > < br / > < sub > < b > nuomi1< / b > < / sub > < / a > < br / > < sub > Swift< / sub > < / td >
< td align = "center" > < a href = "https://github.com/Reanon" > < img style = "border-radius: 50%;" src = "https://avatars.githubusercontent.com/u/22005836?v=4" width = "50px;" alt = "Reanon" / > < br / > < sub > < b > Reanon< / b > < / sub > < / a > < br / > < sub > Go, C< / sub > < / td >
< td align = "center" > < a href = "https://github.com/sjinzh" > < img style = "border-radius: 50%;" src = "https://avatars.githubusercontent.com/u/99076655?v=4" width = "50px;" alt = "sjinzh" / > < br / > < sub > < b > sjinzh< / b > < / sub > < / a > < br / > < sub > Rust, Zig< / sub > < / td >
2023-02-09 19:44:54 +08:00
< / tbody >
< / table >
< / div >