{"id":13424836,"url":"https://github.com/labuladong/fucking-algorithm","last_synced_at":"2025-05-12T17:54:21.151Z","repository":{"id":37255598,"uuid":"241576270","full_name":"labuladong/fucking-algorithm","owner":"labuladong","description":"刷算法全靠套路，认准 labuladong 就够了！English version supported! Crack LeetCode, not only how, but also why. ","archived":false,"fork":false,"pushed_at":"2025-01-31T06:30:22.000Z","size":126276,"stargazers_count":127790,"open_issues_count":42,"forks_count":23356,"subscribers_count":2289,"default_branch":"master","last_synced_at":"2025-05-05T15:16:34.868Z","etag":null,"topics":["algorithms","computer-science","data-structures","dynamic-programming","dynamic-programming-algorithm","interview-questions","kmp","leetcode"],"latest_commit_sha":null,"homepage":"https://labuladong.online/algo/","language":"Markdown","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/labuladong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-19T09:01:23.000Z","updated_at":"2025-05-05T13:31:52.000Z","dependencies_parsed_at":"2024-10-28T18:38:15.739Z","dependency_job_id":"76681d8f-bf7b-4cb3-8dae-f12d79f8bad1","html_url":"https://github.com/labuladong/fucking-algorithm","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labuladong%2Ffucking-algorithm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labuladong%2Ffucking-algorithm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labuladong%2Ffucking-algorithm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labuladong%2Ffucking-algorithm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/labuladong","download_url":"https://codeload.github.com/labuladong/fucking-algorithm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252522172,"owners_count":21761685,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithms","computer-science","data-structures","dynamic-programming","dynamic-programming-algorithm","interview-questions","kmp","leetcode"],"created_at":"2024-07-31T00:00:59.983Z","updated_at":"2025-05-05T15:17:19.353Z","avatar_url":"https://github.com/labuladong.png","language":"Markdown","funding_links":[],"categories":["算法","HarmonyOS","Markdown","学习资源","inbox","TODO","Algorithm","Programming Language Tutorials","字体","Others","计算机编程 数据结构与算法","数据结构与算法","Github","Others (1002)","Table of Contents","武器库"],"sub_categories":["Windows Manager","算法项目","Algorithm","For Scala","数据结构与算法","网络服务_其他","Classical Algorithm","算法"],"readme":"[![Star History Chart](https://api.star-history.com/svg?repos=labuladong/fucking-algorithm\u0026type=Date)](https://star-history.com/#labuladong/fucking-algorithm\u0026Date)\n\n\nEnglish version is on [labuladong.online](https://labuladong.online/algo/en/) too. Just enjoy：)\n\n# labuladong 的算法笔记\n\n本仓库总共 60 多篇原创文章，都是基于 LeetCode 的题目，涵盖了所有题型和技巧，而且一定要做到**举一反三，通俗易懂**，绝不是简单的代码堆砌，后面有目录。\n\n我先吐槽几句。**刷题刷题，刷的是题，培养的是思维，本仓库的目的就是传递这种算法思维**。我要是只写一个包含 LeetCode 题目代码的仓库，有个锤子用？没有思路解释，没有思维框架，顶多写个时间复杂度，那玩意一眼就能看出来。\n\n只想要答案的话很容易，题目评论区五花八门的答案，动不动就秀 python 一行代码解决，有那么多人点赞。问题是，你去做算法题，是去学习编程语言的奇技淫巧的，还是学习算法思维的呢？你的快乐，到底源自复制别人的一行代码通过测试，已完成题目 +1，还是源自自己通过逻辑推理和算法框架不看答案写出解法？\n\n网上总有大佬喷我，说我写的东西太基础，要么说不能借助框架思维来学习算法。我只能说大家刷算法就是找工作吃饭的，不是打竞赛的，我也是一路摸爬滚打过来的，我们要的是清楚明白有所得，不是故弄玄虚无所指。\n\n不想办法做到通俗易懂，难道要上来先把《算法导论》吹上天，然后把人家都心怀敬仰地劝退？\n\n**做啥事情做多了，都能发现套路的，我把各种算法套路框架总结出来，相信可以帮助其他人少走弯路**。我这个纯靠自学的小童鞋，花了一年时间刷题和总结，自己写了一份算法小抄，后面有目录，这里就不废话了。\n\n## 在开始学习之前\n\n**1、先给本仓库点个 star，满足一下我的虚荣心**，文章质量绝对值你一个 star。我还在继续创作，给我一点继续写文的动力，感谢。\n\n**2、建议收藏我的在线网站，每篇文章开头都有对应的力扣题目链接，可以边看文章边刷题，一共可以手把手带你刷 500 道题目**：\n\n2024 最新地址：https://labuladong.online/algo/\n\n~~GitHub Pages 地址：https://labuladong.online/algo/~~\n\n~~Gitee Pages 地址：https://labuladong.gitee.io/algo/~~\n\n## labuladong 刷题全家桶简介\n\n### 一、算法可视化面板\n\n我的算法网站、所有配套插件都集成了一个算法可视化工具，可以对数据结构和递归过程进行可视化，大幅降低理解算法的难度。几乎每道题目的解法代码都有对应的可视化面板，具体参见下方介绍。\n\n\n### 二、学习网站\n\n内容当然是我的系列算法教程中最核心的部分，我的算法教程都发布在网站 [labuladong.online](https://labuladong.online/algo/) 上，相信你会未来会在这里花费大量的学习时间，而不是仅仅加入收藏夹~\n\n![](https://labuladong.github.io/pictures/简介/web_intro1.jpg)\n\n### 三、Chrome 插件\n\n**主要功能**：Chrome 插件可以在中文版力扣或英文版 LeetCode 上快捷查看我的「题解」或「思路」，并添加了题目和算法技巧之间的引用关系，可以和我的网站/公众号/课程联动，给我的读者提供最丝滑的刷题体验。安装使用手册见下方目录。\n\n![](https://labuladong.github.io/pictures/简介/chrome_intro.jpg)\n\n\n### 四、vscode 插件\n\n**主要功能**：和 Chrome 插件功能基本相同，习惯在 vscode 上刷题的读者可以使用该插件。安装使用手册见下方目录。\n\n![](https://labuladong.github.io/pictures/简介/vs_intro.jpg)\n\n\n### 五、Jetbrains 插件\n\n**主要功能**：和 Chrome 插件功能基本相同，习惯在 Jetbrains 家的 IDE（PyCharm/Intellij/Goland 等）上刷题的读者可以使用该插件。安装使用手册见下方目录。\n\n![](https://labuladong.github.io/pictures/简介/jb_intro.jpg)\n\n\n最后祝大家学习愉快，在题海中自在遨游！\n\n\n# 文章目录\n\n\u003c!-- table start --\u003e\n\n### [本站简介](https://labuladong.online/algo/home/)\n\n### [配套插件及算法可视化](https://labuladong.online/algo/menu/tools/)\n  * [配套 Chrome 刷题插件](https://labuladong.online/algo/intro/chrome/)\n  * [配套 vscode 刷题插件](https://labuladong.online/algo/intro/vscode/)\n  * [配套 JetBrains 刷题插件](https://labuladong.online/algo/intro/jetbrains/)\n  * [算法可视化面板使用说明](https://labuladong.online/algo/intro/visualize/)\n  * [本站付费会员](https://labuladong.online/algo/intro/site-vip/)\n\n### [针对初学和速成的学习规划](https://labuladong.online/algo/menu/plan/)\n  * [算法刷题的重点和坑](https://labuladong.online/algo/intro/how-to-learn-algorithms/)\n  * [初学者学习规划](https://labuladong.online/algo/intro/beginner-learning-plan/)\n  * [速成学习规划](https://labuladong.online/algo/intro/quick-learning-plan/)\n  * [习题章节的练习/复习方法](https://labuladong.online/algo/intro/how-to-practice/)\n  * [算法可视化速查页](https://labuladong.online/algo/intro/visualize-catalog/)\n\n### [入门：编程语言基础及练习](https://labuladong.online/algo/menu/)\n  * [本章导读](https://labuladong.online/algo/intro/programming-language-basic/)\n  * [C++ 语言基础](https://labuladong.online/algo/programming-language-basic/cpp/)\n  * [Java 语言基础](https://labuladong.online/algo/programming-language-basic/java/)\n  * [Golang 语言基础](https://labuladong.online/algo/programming-language-basic/golang/)\n  * [Python 语言基础](https://labuladong.online/algo/programming-language-basic/python/)\n  * [JavaScript 语言基础](https://labuladong.online/algo/intro/js/)\n  * [力扣/LeetCode 解题须知](https://labuladong.online/algo/intro/leetcode/)\n  * [编程语言刷题实践](https://labuladong.online/algo/programming-language-basic/lc-practice/)\n\n### [基础：数据结构及排序精讲](https://labuladong.online/algo/menu/quick-start/)\n  * [本章导读](https://labuladong.online/algo/intro/data-structure-basic/)\n  * [时间空间复杂度入门](https://labuladong.online/algo/intro/complexity-basic/)\n\n  * [手把手带你实现动态数组](https://labuladong.online/algo/menu/dynamic-array/)\n    * [数组（顺序存储）基本原理](https://labuladong.online/algo/data-structure-basic/array-basic/)\n    * [动态数组代码实现](https://labuladong.online/algo/data-structure-basic/array-implement/)\n\n  * [手把手带你实现单/双链表](https://labuladong.online/algo/menu/linked-list/)\n    * [链表（链式存储）基本原理](https://labuladong.online/algo/data-structure-basic/linkedlist-basic/)\n    * [链表代码实现](https://labuladong.online/algo/data-structure-basic/linkedlist-implement/)\n\n  * [手把手带你实现队列/栈](https://labuladong.online/algo/menu/queue-stack/)\n    * [队列/栈基本原理](https://labuladong.online/algo/data-structure-basic/queue-stack-basic/)\n    * [用链表实现队列/栈](https://labuladong.online/algo/data-structure-basic/linked-queue-stack/)\n    * [环形数组技巧](https://labuladong.online/algo/data-structure-basic/cycle-array/)\n    * [用数组实现队列/栈](https://labuladong.online/algo/data-structure-basic/array-queue-stack/)\n    * [双端队列（Deque）原理及实现](https://labuladong.online/algo/data-structure-basic/deque-implement/)\n\n  * [哈希表的原理及实现](https://labuladong.online/algo/menu/)\n    * [哈希表核心原理](https://labuladong.online/algo/data-structure-basic/hashmap-basic/)\n    * [用拉链法实现哈希表](https://labuladong.online/algo/data-structure-basic/hashtable-chaining/)\n    * [线性探查法的两个难点](https://labuladong.online/algo/data-structure-basic/linear-probing-key-point/)\n    * [线性探查法的两种代码实现](https://labuladong.online/algo/data-structure-basic/linear-probing-code/)\n    * [哈希集合的原理及代码实现](https://labuladong.online/algo/data-structure-basic/hash-set/)\n\n  * [哈希表结构的种种变换](https://labuladong.online/algo/menu/)\n    * [用链表加强哈希表（LinkedHashMap）](https://labuladong.online/algo/data-structure-basic/hashtable-with-linked-list/)\n    * [用数组加强哈希表（ArrayHashMap）](https://labuladong.online/algo/data-structure-basic/hashtable-with-array/)\n\n  * [二叉树结构及遍历](https://labuladong.online/algo/menu/binary-tree/)\n    * [二叉树基础及常见类型](https://labuladong.online/algo/data-structure-basic/binary-tree-basic/)\n    * [二叉树的递归/层序遍历](https://labuladong.online/algo/data-structure-basic/binary-tree-traverse-basic/)\n    * [多叉树的递归/层序遍历](https://labuladong.online/algo/data-structure-basic/n-ary-tree-traverse-basic/)\n\n  * [二叉树结构的种种变换](https://labuladong.online/algo/menu/binary-tree/)\n    * [二叉搜索树的应用及可视化](https://labuladong.online/algo/data-structure-basic/tree-map-basic/)\n    * [红黑树的完美平衡及可视化](https://labuladong.online/algo/data-structure-basic/rbtree-basic/)\n    * [Trie/字典树/前缀树原理及可视化](https://labuladong.online/algo/data-structure-basic/trie-map-basic/)\n    * [二叉堆核心原理及可视化](https://labuladong.online/algo/data-structure-basic/binary-heap-basic/)\n    * [二叉堆/优先级队列代码实现](https://labuladong.online/algo/data-structure-basic/binary-heap-implement/)\n    * [线段树核心原理及可视化](https://labuladong.online/algo/data-structure-basic/segment-tree-basic/)\n    * [正在更新 ing](https://labuladong.online/algo/intro/updating/)\n\n  * [图论数据结构及遍历](https://labuladong.online/algo/menu/graph-theory/)\n    * [图结构基础及通用代码实现](https://labuladong.online/algo/data-structure-basic/graph-basic/)\n    * [图结构的 DFS/BFS 遍历](https://labuladong.online/algo/data-structure-basic/graph-traverse-basic/)\n    * [Union Find 并查集原理](https://labuladong.online/algo/data-structure-basic/union-find-basic/)\n    * [正在更新 ing](https://labuladong.online/algo/intro/updating/)\n\n  * [十大排序算法原理及可视化](https://labuladong.online/algo/menu/sorting/)\n    * [本章导读](https://labuladong.online/algo/intro/sorting/)\n    * [排序算法的关键指标](https://labuladong.online/algo/data-structure-basic/sort-basic/)\n    * [选择排序所面临的问题](https://labuladong.online/algo/data-structure-basic/select-sort/)\n    * [拥有稳定性：冒泡排序](https://labuladong.online/algo/data-structure-basic/bubble-sort/)\n    * [运用逆向思维：插入排序](https://labuladong.online/algo/data-structure-basic/insertion-sort/)\n    * [突破 O(N^2)：希尔排序](https://labuladong.online/algo/data-structure-basic/shell-sort/)\n    * [妙用二叉树前序位置：快速排序](https://labuladong.online/algo/data-structure-basic/quick-sort/)\n    * [妙用二叉树后序位置：归并排序](https://labuladong.online/algo/data-structure-basic/merge-sort/)\n    * [二叉堆结构的运用：堆排序](https://labuladong.online/algo/data-structure-basic/heap-sort/)\n    * [全新的排序原理：计数排序](https://labuladong.online/algo/data-structure-basic/counting-sort/)\n    * [博采众长：桶排序](https://labuladong.online/algo/data-structure-basic/bucket-sort/)\n    * [基数排序（Radix Sort）](https://labuladong.online/algo/data-structure-basic/radix-sort/)\n\n  * [正在更新 ing](https://labuladong.online/algo/intro/updating/)\n\n\n### [第零章、核心刷题框架汇总](https://labuladong.online/algo/menu/core/)\n  * [本章导读](https://labuladong.online/algo/intro/core-intro/)\n  * [学习数据结构和算法的框架思维](https://labuladong.online/algo/essential-technique/algorithm-summary/)\n  * [双指针技巧秒杀七道链表题目](https://labuladong.online/algo/essential-technique/linked-list-skills-summary/)\n  * [双指针技巧秒杀七道数组题目](https://labuladong.online/algo/essential-technique/array-two-pointers-summary/)\n  * [滑动窗口算法核心代码模板](https://labuladong.online/algo/essential-technique/sliding-window-framework/)\n  * [二分搜索算法核心代码模板](https://labuladong.online/algo/essential-technique/binary-search-framework/)\n  * [动态规划解题套路框架](https://labuladong.online/algo/essential-technique/dynamic-programming-framework/)\n  * [回溯算法解题套路框架](https://labuladong.online/algo/essential-technique/backtrack-framework/)\n  * [BFS 算法解题套路框架](https://labuladong.online/algo/essential-technique/bfs-framework/)\n  * [二叉树系列算法核心纲领](https://labuladong.online/algo/essential-technique/binary-tree-summary/)\n  * [回溯算法秒杀所有排列/组合/子集问题](https://labuladong.online/algo/essential-technique/permutation-combination-subset-all-in-one/)\n  * [贪心算法解题套路框架](https://labuladong.online/algo/essential-technique/greedy/)\n  * [分治算法解题套路框架](https://labuladong.online/algo/essential-technique/divide-and-conquer/)\n  * [算法时空复杂度分析实用指南](https://labuladong.online/algo/essential-technique/complexity-analysis/)\n\n\n### [第一章、经典数据结构算法](https://labuladong.online/algo/menu/ds/)\n  * [手把手刷链表算法](https://labuladong.online/algo/menu/linked-list/)\n    * [双指针技巧秒杀七道链表题目](https://labuladong.online/algo/essential-technique/linked-list-skills-summary/)\n    * [【强化练习】链表双指针经典习题](https://labuladong.online/algo/problem-set/linkedlist-two-pointers/)\n    * [单链表的花式反转方法汇总](https://labuladong.online/algo/data-structure/reverse-linked-list-recursion/)\n    * [如何判断回文链表](https://labuladong.online/algo/data-structure/palindrome-linked-list/)\n\n  * [手把手刷数组算法](https://labuladong.online/algo/menu/array/)\n    * [双指针技巧秒杀七道数组题目](https://labuladong.online/algo/essential-technique/array-two-pointers-summary/)\n    * [二维数组的花式遍历技巧](https://labuladong.online/algo/practice-in-action/2d-array-traversal-summary/)\n    * [一个方法团灭 nSum 问题](https://labuladong.online/algo/practice-in-action/nsum/)\n    * [【强化练习】数组双指针经典习题](https://labuladong.online/algo/problem-set/array-two-pointers/)\n    * [小而美的算法技巧：前缀和数组](https://labuladong.online/algo/data-structure/prefix-sum/)\n    * [【强化练习】前缀和技巧经典习题](https://labuladong.online/algo/problem-set/perfix-sum/)\n    * [小而美的算法技巧：差分数组](https://labuladong.online/algo/data-structure/diff-array/)\n    * [滑动窗口算法核心代码模板](https://labuladong.online/algo/essential-technique/sliding-window-framework/)\n    * [【强化练习】滑动窗口算法经典习题](https://labuladong.online/algo/problem-set/sliding-window/)\n    * [滑动窗口延伸：Rabin Karp 字符匹配算法](https://labuladong.online/algo/practice-in-action/rabinkarp/)\n    * [二分搜索算法核心代码模板](https://labuladong.online/algo/essential-technique/binary-search-framework/)\n    * [实际运用二分搜索时的思维框架](https://labuladong.online/algo/frequency-interview/binary-search-in-action/)\n    * [【强化练习】二分搜索算法经典习题](https://labuladong.online/algo/problem-set/binary-search/)\n    * [带权重的随机选择算法](https://labuladong.online/algo/frequency-interview/random-pick-with-weight/)\n    * [田忌赛马背后的算法决策](https://labuladong.online/algo/practice-in-action/advantage-shuffle/)\n\n\n  * [手把手刷二叉树算法](https://labuladong.online/algo/menu/binary-tree/)\n    * [二叉树系列算法核心纲领](https://labuladong.online/algo/essential-technique/binary-tree-summary/)\n    * [二叉树心法（思路篇）](https://labuladong.online/algo/data-structure/binary-tree-part1/)\n    * [二叉树心法（构造篇）](https://labuladong.online/algo/data-structure/binary-tree-part2/)\n    * [二叉树心法（后序篇）](https://labuladong.online/algo/data-structure/binary-tree-part3/)\n    * [二叉树心法（序列化篇）](https://labuladong.online/algo/data-structure/serialize-and-deserialize-binary-tree/)\n    * [二叉搜索树心法（特性篇）](https://labuladong.online/algo/data-structure/bst-part1/)\n    * [二叉搜索树心法（基操篇）](https://labuladong.online/algo/data-structure/bst-part2/)\n    * [二叉搜索树心法（构造篇）](https://labuladong.online/algo/data-structure/bst-part3/)\n    * [二叉搜索树心法（后序篇）](https://labuladong.online/algo/data-structure/bst-part4/)\n\n  * [套模板解决 100 道二叉树习题](https://labuladong.online/algo/menu/100-bt/)\n    * [本章导读](https://labuladong.online/algo/intro/binary-tree-practice/)\n    * [【强化练习】用「遍历」思维解题 I](https://labuladong.online/algo/problem-set/binary-tree-traverse-i/)\n    * [【强化练习】用「遍历」思维解题 II](https://labuladong.online/algo/problem-set/binary-tree-traverse-ii/)\n    * [【强化练习】用「遍历」思维解题 III](https://labuladong.online/algo/problem-set/binary-tree-traverse-iii/)\n    * [【强化练习】用「分解问题」思维解题 I](https://labuladong.online/algo/problem-set/binary-tree-divide-i/)\n    * [【强化练习】用「分解问题」思维解题 II](https://labuladong.online/algo/problem-set/binary-tree-divide-ii/)\n    * [【强化练习】同时运用两种思维解题](https://labuladong.online/algo/problem-set/binary-tree-combine-two-view/)\n    * [【强化练习】利用后序位置解题 I](https://labuladong.online/algo/problem-set/binary-tree-post-order-i/)\n    * [【强化练习】利用后序位置解题 II](https://labuladong.online/algo/problem-set/binary-tree-post-order-ii/)\n    * [【强化练习】利用后序位置解题 III](https://labuladong.online/algo/problem-set/binary-tree-post-order-iii/)\n    * [【强化练习】运用层序遍历解题 I](https://labuladong.online/algo/problem-set/binary-tree-level-i/)\n    * [【强化练习】运用层序遍历解题 II](https://labuladong.online/algo/problem-set/binary-tree-level-ii/)\n    * [【强化练习】二叉搜索树经典例题 I](https://labuladong.online/algo/problem-set/bst1/)\n    * [【强化练习】二叉搜索树经典例题 II](https://labuladong.online/algo/problem-set/bst2/)\n\n  * [二叉树的拓展延伸](https://labuladong.online/algo/menu/more-bt/)\n    * [拓展：最近公共祖先系列解题框架](https://labuladong.online/algo/practice-in-action/lowest-common-ancestor-summary/)\n    * [拓展：如何计算完全二叉树的节点数](https://labuladong.online/algo/data-structure/count-complete-tree-nodes/)\n    * [拓展：惰性展开多叉树](https://labuladong.online/algo/data-structure/flatten-nested-list-iterator/)\n    * [拓展：归并排序详解及应用](https://labuladong.online/algo/practice-in-action/merge-sort/)\n    * [拓展：快速排序详解及应用](https://labuladong.online/algo/practice-in-action/quick-sort/)\n    * [拓展：用栈模拟递归迭代遍历二叉树](https://labuladong.online/algo/data-structure/iterative-traversal-binary-tree/)\n\n  * [手把手设计数据结构](https://labuladong.online/algo/menu/design/)\n    * [队列实现栈以及栈实现队列](https://labuladong.online/algo/data-structure/stack-queue/)\n    * [【强化练习】栈的经典习题](https://labuladong.online/algo/problem-set/stack/)\n    * [【强化练习】括号类问题汇总](https://labuladong.online/algo/problem-set/parentheses/)\n    * [【强化练习】队列的经典习题](https://labuladong.online/algo/problem-set/queue/)\n    * [单调栈算法模板解决三道例题](https://labuladong.online/algo/data-structure/monotonic-stack/)\n    * [【强化练习】单调栈的几种变体及经典习题](https://labuladong.online/algo/problem-set/monotonic-stack/)\n    * [单调队列结构解决滑动窗口问题](https://labuladong.online/algo/data-structure/monotonic-queue/)\n    * [【强化练习】单调队列的通用实现及经典习题](https://labuladong.online/algo/problem-set/monotonic-queue/)\n    * [算法就像搭乐高：手撸 LRU 算法](https://labuladong.online/algo/data-structure/lru-cache/)\n    * [算法就像搭乐高：手撸 LFU 算法](https://labuladong.online/algo/frequency-interview/lfu/)\n    * [常数时间删除/查找数组中的任意元素](https://labuladong.online/algo/data-structure/random-set/)\n    * [【强化练习】哈希表更多习题](https://labuladong.online/algo/problem-set/hash-table/)\n    * [【强化练习】优先级队列经典习题](https://labuladong.online/algo/problem-set/binary-heap/)\n    * [TreeMap/TreeSet 代码实现](https://labuladong.online/algo/data-structure-basic/tree-map-implement/)\n    * [SegmentTree 线段树代码实现](https://labuladong.online/algo/data-structure/segment-tree-implement/)\n    * [Trie/字典树/前缀树代码实现](https://labuladong.online/algo/data-structure/trie-implement/)\n    * [【强化练习】Trie 树算法习题](https://labuladong.online/algo/problem-set/trie/)\n    * [设计朋友圈时间线功能](https://labuladong.online/algo/data-structure/design-twitter/)\n    * [设计考场座位分配算法](https://labuladong.online/algo/frequency-interview/exam-room/)\n    * [【强化练习】更多经典设计习题](https://labuladong.online/algo/problem-set/ds-design/)\n    * [拓展：如何实现一个计算器](https://labuladong.online/algo/data-structure/implement-calculator/)\n    * [拓展：两个二叉堆实现中位数算法](https://labuladong.online/algo/practice-in-action/find-median-from-data-stream/)\n    * [拓展：数组去重问题（困难版）](https://labuladong.online/algo/frequency-interview/remove-duplicate-letters/)\n\n\n  * [手把手刷图算法](https://labuladong.online/algo/menu/graph/)\n    * [环检测及拓扑排序算法](https://labuladong.online/algo/data-structure/topological-sort/)\n    * [众里寻他千百度：名流问题](https://labuladong.online/algo/frequency-interview/find-celebrity/)\n    * [二分图判定算法](https://labuladong.online/algo/data-structure/bipartite-graph/)\n    * [Union-Find 并查集算法](https://labuladong.online/algo/data-structure/union-find/)\n    * [【强化练习】并查集经典习题](https://labuladong.online/algo/problem-set/union-find/)\n    * [Kruskal 最小生成树算法](https://labuladong.online/algo/data-structure/kruskal/)\n    * [Prim 最小生成树算法](https://labuladong.online/algo/data-structure/prim/)\n    * [Dijkstra 算法模板及应用](https://labuladong.online/algo/data-structure/dijkstra/)\n    * [【强化练习】Dijkstra 算法经典习题](https://labuladong.online/algo/problem-set/dijkstra/)\n\n### [第二章、经典暴力搜索算法](https://labuladong.online/algo/menu/braute-force-search/)\n  * [DFS/回溯算法](https://labuladong.online/algo/menu/dfs/)\n    * [回溯算法解题套路框架](https://labuladong.online/algo/essential-technique/backtrack-framework/)\n    * [回溯算法实践：数独和 N 皇后问题](https://labuladong.online/algo/practice-in-action/sudoku-nqueue/)\n    * [回溯算法秒杀所有排列/组合/子集问题](https://labuladong.online/algo/essential-technique/permutation-combination-subset-all-in-one/)\n    * [球盒模型：回溯算法穷举的两种视角](https://labuladong.online/algo/practice-in-action/two-views-of-backtrack/)\n    * [解答回溯算法/DFS算法的若干疑问](https://labuladong.online/algo/essential-technique/backtrack-vs-dfs/)\n    * [一文秒杀所有岛屿题目](https://labuladong.online/algo/frequency-interview/island-dfs-summary/)\n    * [回溯算法实践：括号生成](https://labuladong.online/algo/practice-in-action/generate-parentheses/)\n    * [回溯算法实践：集合划分](https://labuladong.online/algo/practice-in-action/partition-to-k-equal-sum-subsets/)\n    * [【强化练习】回溯算法经典习题 I](https://labuladong.online/algo/problem-set/backtrack-i/)\n    * [【强化练习】回溯算法经典习题 II](https://labuladong.online/algo/problem-set/backtrack-ii/)\n    * [【强化练习】回溯算法经典习题 III](https://labuladong.online/algo/problem-set/backtrack-iii/)\n\n  * [BFS 算法](https://labuladong.online/algo/menu/bfs/)\n    * [BFS 算法解题套路框架](https://labuladong.online/algo/essential-technique/bfs-framework/)\n    * [【强化练习】BFS 经典习题 I](https://labuladong.online/algo/problem-set/bfs/)\n    * [【强化练习】BFS 经典习题 II](https://labuladong.online/algo/problem-set/bfs-ii/)\n    * [正在更新 ing](https://labuladong.online/algo/intro/updating/)\n\n\n### [第三章、经典动态规划算法](https://labuladong.online/algo/menu/dp/)\n  * [动态规划基本技巧](https://labuladong.online/algo/menu/dp-basic/)\n    * [动态规划解题套路框架](https://labuladong.online/algo/essential-technique/dynamic-programming-framework/)\n    * [动态规划设计：最长递增子序列](https://labuladong.online/algo/dynamic-programming/longest-increasing-subsequence/)\n    * [base case 和备忘录的初始值怎么定？](https://labuladong.online/algo/dynamic-programming/memo-fundamental/)\n    * [动态规划穷举的两种视角](https://labuladong.online/algo/dynamic-programming/two-views-of-dp/)\n    * [动态规划和回溯算法的思维转换](https://labuladong.online/algo/dynamic-programming/word-break/)\n    * [对动态规划进行降维打击](https://labuladong.online/algo/dynamic-programming/space-optimization/)\n    * [最优子结构原理和 dp 数组遍历方向](https://labuladong.online/algo/dynamic-programming/faq-summary/)\n\n  * [子序列类型问题](https://labuladong.online/algo/menu/subsequence/)\n    * [经典动态规划：编辑距离](https://labuladong.online/algo/dynamic-programming/edit-distance/)\n    * [动态规划设计：最大子数组](https://labuladong.online/algo/dynamic-programming/maximum-subarray/)\n    * [经典动态规划：最长公共子序列](https://labuladong.online/algo/dynamic-programming/longest-common-subsequence/)\n    * [动态规划之子序列问题解题模板](https://labuladong.online/algo/dynamic-programming/subsequence-problem/)\n\n  * [背包类型问题](https://labuladong.online/algo/menu/knapsack/)\n    * [经典动态规划：0-1 背包问题](https://labuladong.online/algo/dynamic-programming/knapsack1/)\n    * [经典动态规划：子集背包问题](https://labuladong.online/algo/dynamic-programming/knapsack2/)\n    * [经典动态规划：完全背包问题](https://labuladong.online/algo/dynamic-programming/knapsack3/)\n    * [背包问题的变体：目标和](https://labuladong.online/algo/dynamic-programming/target-sum/)\n\n  * [用动态规划玩游戏](https://labuladong.online/algo/menu/dp-game/)\n    * [动态规划之最小路径和](https://labuladong.online/algo/dynamic-programming/minimum-path-sum/)\n    * [动态规划帮我通关了《魔塔》](https://labuladong.online/algo/dynamic-programming/magic-tower/)\n    * [动态规划帮我通关了《辐射4》](https://labuladong.online/algo/dynamic-programming/freedom-trail/)\n    * [旅游省钱大法：加权最短路径](https://labuladong.online/algo/dynamic-programming/cheap-travel/)\n    * [经典动态规划：正则表达式](https://labuladong.online/algo/dynamic-programming/regular-expression-matching/)\n    * [经典动态规划：高楼扔鸡蛋](https://labuladong.online/algo/dynamic-programming/egg-drop/)\n    * [经典动态规划：戳气球](https://labuladong.online/algo/dynamic-programming/burst-balloons/)\n    * [经典动态规划：博弈问题](https://labuladong.online/algo/dynamic-programming/game-theory/)\n    * [一个方法团灭 LeetCode 打家劫舍问题](https://labuladong.online/algo/dynamic-programming/house-robber/)\n    * [一个方法团灭 LeetCode 股票买卖问题](https://labuladong.online/algo/dynamic-programming/stock-problem-summary/)\n\n  * [贪心类型问题](https://labuladong.online/algo/menu/greedy/)\n    * [贪心算法解题套路框架](https://labuladong.online/algo/essential-technique/greedy/)\n    * [老司机加油算法](https://labuladong.online/algo/frequency-interview/gas-station-greedy/)\n    * [贪心算法之区间调度问题](https://labuladong.online/algo/frequency-interview/interval-scheduling/)\n    * [扫描线技巧：安排会议室](https://labuladong.online/algo/frequency-interview/scan-line-technique/)\n    * [剪视频剪出一个贪心算法](https://labuladong.online/algo/frequency-interview/cut-video/)\n\n\n### [第四章、其他常见算法技巧](https://labuladong.online/algo/menu/other/)\n  * [数学运算技巧](https://labuladong.online/algo/menu/math/)\n    * [一行代码就能解决的算法题](https://labuladong.online/algo/frequency-interview/one-line-solutions/)\n    * [常用的位操作](https://labuladong.online/algo/frequency-interview/bitwise-operation/)\n    * [谈谈游戏中的随机算法](https://labuladong.online/algo/frequency-interview/random-algorithm/)\n    * [讲两道常考的阶乘算法题](https://labuladong.online/algo/frequency-interview/factorial-problems/)\n    * [如何高效寻找素数](https://labuladong.online/algo/frequency-interview/print-prime-number/)\n    * [如何高效进行模幂运算](https://labuladong.online/algo/frequency-interview/quick-power/)\n    * [如何同时寻找缺失和重复的元素](https://labuladong.online/algo/frequency-interview/mismatch-set/)\n    * [几个反直觉的概率问题](https://labuladong.online/algo/frequency-interview/probability-problem/)\n    * [【强化练习】数学技巧相关习题](https://labuladong.online/algo/problem-set/math-tricks/)\n\n  * [经典面试题](https://labuladong.online/algo/menu/interview/)\n    * [算法笔试「骗分」套路](https://labuladong.online/algo/other-skills/tips-in-exam/)\n    * [如何高效解决接雨水问题](https://labuladong.online/algo/frequency-interview/trapping-rain-water/)\n    * [一文秒杀所有丑数系列问题](https://labuladong.online/algo/frequency-interview/ugly-number-summary/)\n    * [一个方法解决三道区间问题](https://labuladong.online/algo/practice-in-action/interval-problem-summary/)\n    * [谁能想到，斗地主也能玩出算法](https://labuladong.online/algo/practice-in-action/split-array-into-consecutive-subsequences/)\n    * [烧饼排序算法](https://labuladong.online/algo/frequency-interview/pancake-sorting/)\n    * [字符串乘法计算](https://labuladong.online/algo/practice-in-action/multiply-strings/)\n    * [如何判定完美矩形](https://labuladong.online/algo/frequency-interview/perfect-rectangle/)\n\n### [附录](https://labuladong.online/algo/menu/appendix/)\n  * [labuladong.online 更新日志](https://labuladong.online/algo/changelog/website/)\n  * [可视化面板更新日志](https://labuladong.online/algo/changelog/visualize/)\n  * [Chrome 刷题插件更新日志](https://labuladong.online/algo/changelog/chrome/)\n  * [vscode 刷题插件更新日志](https://labuladong.online/algo/changelog/vscode/)\n  * [Jetbrain 刷题插件更新日志](https://labuladong.online/algo/changelog/jetbrain/)\n  * [网站/插件问题反馈](https://labuladong.online/algo/intro/bug-report/)\n\n\u003c!-- table end --\u003e\n\n# 感谢如下大佬参与翻译\n\n按照昵称字典序排名：\n\n[ABCpril](https://github.com/ABCpril), \n[andavid](https://github.com/andavid), \n[bryceustc](https://github.com/bryceustc), \n[build2645](https://github.com/build2645), \n[CarrieOn](https://github.com/CarrieOn), \n[cooker](https://github.com/xiaochuhub), \n[Dong Wang](https://github.com/Coder2Programmer), \n[ExcaliburEX](https://github.com/ExcaliburEX), \n[floatLig](https://github.com/floatLig), \n[ForeverSolar](https://github.com/foreversolar), \n[Fulin Li](https://fulinli.github.io/), \n[Funnyyanne](https://github.com/Funnyyanne), \n[GYHHAHA](https://github.com/GYHHAHA), \n[Hi_archer](https://hiarcher.top/), \n[Iruze](https://github.com/Iruze), \n[Jieyixia](https://github.com/Jieyixia), \n[Justin](https://github.com/Justin-YGG), \n[Kevin](https://github.com/Kevin-free), \n[Lrc123](https://github.com/Lrc123), \n[lriy](https://github.com/lriy), \n[Lyjeeq](https://github.com/Lyjeeq), \n[MasonShu](https://greenwichmt.github.io/), \n[Master-cai](https://github.com/Master-cai), \n[miaoxiaozui2017](https://github.com/miaoxiaozui2017), \n[natsunoyoru97](https://github.com/natsunoyoru97), \n[nettee](https://github.com/nettee), \n[PaperJets](https://github.com/PaperJets), \n[qy-yang](https://github.com/qy-yang), \n[realism0331](https://github.com/realism0331), \n[SCUhzs](https://github.com/brucecat), \n[Seaworth](https://github.com/Seaworth), \n[shazi4399](https://github.com/shazi4399), \n[ShuozheLi](https://github.com/ShuoZheLi/), \n[sinjoywong](https://blog.csdn.net/SinjoyWong), \n[sunqiuming526](https://github.com/sunqiuming526), \n[Tianhao Zhou](https://github.com/tianhaoz95), \n[timmmGZ](https://github.com/timmmGZ), \n[tommytim0515](https://github.com/tommytim0515), \n[ucsk](https://github.com/ucsk), \n[wadegrc](https://github.com/wadegrc), \n[walsvid](https://github.com/walsvid), \n[warmingkkk](https://github.com/warmingkkk), \n[Wonderxie](https://github.com/Wonderxie), \n[wsyzxxxx](https://github.com/wsyzxxxx), \n[xiaodp](https://github.com/xiaodp), \n[youyun](https://github.com/youyun), \n[yx-tan](https://github.com/yx-tan), \n[Zero](https://github.com/Mr2er0), \n[Ziming](https://github.com/ML-ZimingMeng/LeetCode-Python3)\n\n# Donate\n\n如果本仓库对你有帮助，可以请作者喝杯速溶咖啡\n\n\u003cimg src=\"pictures/pay.jpg\" width = \"200\" align=center /\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabuladong%2Ffucking-algorithm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flabuladong%2Ffucking-algorithm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabuladong%2Ffucking-algorithm/lists"}