Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/itcharge/leetcode-py

⛽️「算法通关手册」:超详细的「算法与数据结构」基础讲解教程,从零基础开始学习算法知识,850+ 道「LeetCode 题目」详细解析,200 道「大厂面试热门题目」。
https://github.com/itcharge/leetcode-py

acm-icpc algo algorithm algorithms algorithms-datastructures data-structure data-structures interview interviews leetcode leetcode-py leetcode-python leetcode-solutions python

Last synced: 7 days ago
JSON representation

⛽️「算法通关手册」:超详细的「算法与数据结构」基础讲解教程,从零基础开始学习算法知识,850+ 道「LeetCode 题目」详细解析,200 道「大厂面试热门题目」。

Awesome Lists containing this project

README

        

# 算法通关手册(LeetCode)

## 01. 项目简介

- **「算法与数据结构」** 基础知识的讲解教程,「LeetCode」800+ 道题目的详细解析。本项目易于理解,没有大跨度的思维跳跃,项目中使用部分图示、例子来帮助理解。

- 本教程先从基础的数据结构和算法开始讲解,再针对不同分类的数据结构和算法,进行具体题目的讲解分析。让读者可以通过「算法基础理论学习」和「编程实战学习」相结合的方式,彻底的掌握算法知识。

- 本教程采用 Python 作为编程语言,要求学习者已有基本 Python 程序设计的知识与经验。

## 02. 项目地址

欢迎右上角 **「Star ⭐️ 」** 和 **「Fork」**,这是对我最大的鼓励和支持。

- GitHub 地址:[https://github.com/itcharge/LeetCode-Py](https://github.com/itcharge/LeetCode-Py)

支持黑暗模式的在线电子书《算法通关手册》。

- 电子书地址:[https://algo.itcharge.cn](https://algo.itcharge.cn)

![电子书浅色模式](./Assets/Images/algo-book-light.png)

![电子书深色模式](./Assets/Images/algo-book-dark.png)

## 03. 关于作者

我是一名 iOS / macOS 的开发程序员,另外也是北航软院的一名非全硕士(在读)。曾在大学期间学习过算法知识,并参加过 3 年的 ACM 比赛, 但水平有限,未能取得理想成绩。但是这 3 年的 ACM 经历,给我最大的收获是锻炼了自己的逻辑思维和解决实际问题的能力,这种能力为我今后的工作、学习打下了坚实的基础。

我从 2021 年 03 月 30 日开始每日在 LeetCode 刷题,到 2022 年 06 月 08 日已经刷了 1000+ 道题目,并且完成了 800+ 道题解。努力向着 1000+、1500+、2000+ 道题解前进。

在公众号 **「程序员充电站」** 里回复 "**算法打卡**",拉你进 LeetCode 算法打卡计划群一起组队打卡。

- 进群暗号:**算法打卡**
- 进群要求:少闲聊、多分享、改备注。

![](./Assets/Images/itcharge-qr-code.png)

## 04. 版权说明

- 本教程采用 [知识署名—非商业性使用—禁止演绎(BY-NC-ND)4.0 协议国际许可协议](https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode.zh-Hans) 进行许可。
- 本教程题解中的所有题目版权均归 [LeetCode](https://leetcode.com/) 和 [力扣中国](https://leetcode.cn/) 所有。

## 05. 章节目录

![章节目录](./Assets/Images/algo-book-contents.png)

### 00. 绪论

- [算法与数据结构](./Contents/00.Introduction/01.Data-Structures-Algorithms.md)
- [算法复杂度](./Contents/00.Introduction/02.Algorithm-Complexity.md)
- [LeetCode 入门与攻略](./Contents/00.Introduction/03.LeetCode-Guide.md)
- [LeetCode 题解(字典序排序,850+ 道题解)](./Contents/00.Introduction/04.Solutions-List.md)
- [LeetCode 题解(按分类排序,推荐刷题列表 ★★★)](./Contents/00.Introduction/05.Categories-List.md)
- [LeetCode 面试最常考 100 题(按分类排序)](./Contents/00.Introduction/06.Interview-100-List.md)
- [LeetCode 面试最常考 200 题(按分类排序)](./Contents/00.Introduction/07.Interview-200-List.md)

### 01. 数组

- 数组基础知识
- [数组基础知识](./Contents/01.Array/01.Array-Basic/01.Array-Basic.md)
- [数组基础题目](./Contents/01.Array/01.Array-Basic/02.Array-Basic-List.md)
- 数组排序算法
- [冒泡排序](./Contents/01.Array/02.Array-Sort/01.Array-Bubble-Sort.md)
- [选择排序](./Contents/01.Array/02.Array-Sort/02.Array-Selection-Sort.md)
- [插入排序](./Contents/01.Array/02.Array-Sort/03.Array-Insertion-Sort.md)
- [希尔排序](./Contents/01.Array/02.Array-Sort/04.Array-Shell-Sort.md)
- [归并排序](./Contents/01.Array/02.Array-Sort/05.Array-Merge-Sort.md)
- [快速排序](./Contents/01.Array/02.Array-Sort/06.Array-Quick-Sort.md)
- [堆排序](./Contents/01.Array/02.Array-Sort/07.Array-Heap-Sort.md)
- [计数排序](./Contents/01.Array/02.Array-Sort/08.Array-Counting-Sort.md)
- [桶排序](./Contents/01.Array/02.Array-Sort/09.Array-Bucket-Sort.md)
- [基数排序](./Contents/01.Array/02.Array-Sort/10.Array-Radix-Sort.md)
- [数组排序题目](./Contents/01.Array/02.Array-Sort/11.Array-Sort-List.md)
- 二分查找
- [二分查找知识(一)](./Contents/01.Array/03.Array-Binary-Search/01.Array-Binary-Search-01.md)
- [二分查找知识(二)](./Contents/01.Array/03.Array-Binary-Search/02.Array-Binary-Search-02.md)
- [二分查找题目](./Contents/01.Array/03.Array-Binary-Search/03.Array-Binary-Search-List.md)
- 数组双指针
- [数组双指针知识](./Contents/01.Array/04.Array-Two-Pointers/01.Array-Two-Pointers.md)
- [数组双指针题目](./Contents/01.Array/04.Array-Two-Pointers/02.Array-Two-Pointers-List.md)
- 数组滑动窗口
- [数组滑动窗口知识](./Contents/01.Array/05.Array-Sliding-Window/01.Array-Sliding-Window.md)
- [数组滑动窗口题目](./Contents/01.Array/05.Array-Sliding-Window/02.Array-Sliding-Window-List.md)

### 02. 链表

- 链表基础知识
- [链表基础知识](./Contents/02.Linked-List/01.Linked-List-Basic/01.Linked-List-Basic.md)
- [链表经典题目](./Contents/02.Linked-List/01.Linked-List-Basic/02.Linked-List-Basic-List.md)
- 链表排序
- [链表排序知识](./Contents/02.Linked-List/02.Linked-List-Sort/01.Linked-List-Sort.md)
- [链表排序题目](./Contents/02.Linked-List/02.Linked-List-Sort/02.Linked-List-Sort-List.md)
- 链表双指针
- [链表双指针知识](./Contents/02.Linked-List/03.Linked-List-Two-Pointers/01.Linked-List-Two-Pointers.md)
- [链表双指针题目](./Contents/02.Linked-List/03.Linked-List-Two-Pointers/02.Linked-List-Two-Pointers-List.md)

### 03. 堆栈

- 堆栈基础知识
- [堆栈基础知识](./Contents/03.Stack/01.Stack-Basic/01.Stack-Basic.md)
- [堆栈基础题目](./Contents/03.Stack/01.Stack-Basic/02.Stack-Basic-List.md)
- 单调栈
- [单调栈知识](./Contents/03.Stack/02.Monotone-Stack/01.Monotone-Stack.md)
- [单调栈题目](./Contents/03.Stack/02.Monotone-Stack/02.Monotone-Stack-List.md)

### 04. 队列

- 队列基础知识
- [队列基础知识](./Contents/04.Queue/01.Queue-Basic/01.Queue-Basic.md)
- [队列基础题目](./Contents/04.Queue/01.Queue-Basic/02.Queue-Basic-List.md)
- 优先队列
- [优先队列知识](./Contents/04.Queue/02.Priority-Queue/01.Priority-Queue.md)
- [优先队列题目](./Contents/04.Queue/02.Priority-Queue/02.Priority-Queue-List.md)

### 05. 哈希表

- [哈希表知识](./Contents/05.Hash-Table/01.Hash-Table.md)
- [哈希表题目](./Contents/05.Hash-Table/02.Hash-Table-List.md)

### 06. 字符串

- 字符串基础知识
- [字符串基础知识](./Contents/06.String/01.String-Basic/01.String-Basic.md)
- [字符串经典题目](./Contents/06.String/01.String-Basic/02.String-Basic-List.md)
- 单模式串匹配
- [Brute Force 算法](./Contents/06.String/02.String-Single-Pattern-Matching/01.String-Brute-Force.md)
- [Rabin Karp 算法](./Contents/06.String/02.String-Single-Pattern-Matching/02.String-Rabin-Karp.md)
- [KMP 算法](./Contents/06.String/02.String-Single-Pattern-Matching/03.String-KMP.md)
- [Boyer Moore 算法](./Contents/06.String/02.String-Single-Pattern-Matching/04.String-Boyer-Moore.md)
- [Horspool 算法](./Contents/06.String/02.String-Single-Pattern-Matching/05.String-Horspool.md)
- [Sunday 算法](./Contents/06.String/02.String-Single-Pattern-Matching/06.String-Sunday.md)
- [单模式串匹配题目](./Contents/06.String/02.String-Single-Pattern-Matching/07.String-Single-Pattern-Matching-List.md)
- 多模式串匹配
- [字典树知识](./Contents/06.String/03.String-Multi-Pattern-Matching/01.Trie.md)
- [字典树题目](./Contents/06.String/03.String-Multi-Pattern-Matching/02.Trie-List.md)
- [AC 自动机知识](./Contents/06.String/03.String-Multi-Pattern-Matching/03.AC-Automaton.md)
- [AC 自动机题目](./Contents/06.String/03.String-Multi-Pattern-Matching/04.AC-Automaton-List.md)
- [后缀数组知识](./Contents/06.String/03.String-Multi-Pattern-Matching/05.Suffix-Array.md)
- [后缀数组题目](./Contents/06.String/03.String-Multi-Pattern-Matching/06.Suffix-Array-List.md)

### 07. 树

- 二叉树
- [树与二叉树基础知识](./Contents/07.Tree/01.Binary-Tree/01.Binary-Tree-Basic.md)
- [二叉树的遍历知识](./Contents/07.Tree/01.Binary-Tree/02.Binary-Tree-Traverse.md)
- [二叉树的遍历题目](./Contents/07.Tree/01.Binary-Tree/03.Binary-Tree-Traverse-List.md)
- [二叉树的还原知识](./Contents/07.Tree/01.Binary-Tree/04.Binary-Tree-Reduction.md)
- [二叉树的还原题目](./Contents/07.Tree/01.Binary-Tree/05.Binary-Tree-Reduction-List.md)
- 二叉搜索树
- [二叉搜索树知识](./Contents/07.Tree/02.Binary-Search-Tree/01.Binary-Search-Tree.md)
- [二叉搜索树题目](./Contents/07.Tree/02.Binary-Search-Tree/02.Binary-Search-Tree-List.md)
- 线段树
- [线段树知识](./Contents/07.Tree/03.Segment-Tree/01.Segment-Tree.md)
- [线段树题目](./Contents/07.Tree/03.Segment-Tree/02.Segment-Tree-List.md)
- 树状数组
- [树状数组知识](./Contents/07.Tree/04.Binary-Indexed-Tree/01.Binary-Indexed-Tree.md)
- [树状数组题目](./Contents/07.Tree/04.Binary-Indexed-Tree/02.Binary-Indexed-Tree-List.md)
- 并查集
- [并查集知识](./Contents/07.Tree/05.Union-Find/01.Union-Find.md)
- [并查集题目](./Contents/07.Tree/05.Union-Find/02.Union-Find-List.md)

### 08. 图论

- 图的基础知识
- [图的定义和分类](./Contents/08.Graph/01.Graph-Basic/01.Graph-Basic.md)
- [图的存储结构和问题应用](./Contents/08.Graph/01.Graph-Basic/02.Graph-Structure.md)
- 图的遍历
- [图的深度优先搜索知识](./Contents/08.Graph/02.Graph-Traversal/01.Graph-DFS.md)
- [图的深度优先搜索题目](./Contents/08.Graph/02.Graph-Traversal/02.Graph-DFS-List.md)
- [图的广度优先搜索知识](./Contents/08.Graph/02.Graph-Traversal/03.Graph-BFS.md)
- [图的广度优先搜索题目](./Contents/08.Graph/02.Graph-Traversal/04.Graph-BFS-List.md)
- [图的拓扑排序知识](./Contents/08.Graph/02.Graph-Traversal/05.Graph-Topological-Sorting.md)
- [图的拓扑排序题目](./Contents/08.Graph/02.Graph-Traversal/06.Graph-Topological-Sorting-List.md)
- 图的生成树
- [图的最小生成树知识](./Contents/08.Graph/03.Graph-Spanning-Tree/01.Graph-Minimum-Spanning-Tree.md)
- [图的最小生成树题目](./Contents/08.Graph/03.Graph-Spanning-Tree/02.Graph-Minimum-Spanning-Tree-List.md)
- 最短路径
- [单源最短路径知识(一)](./Contents/08.Graph/04.Graph-Shortest-Path/01.Graph-Single-Source-Shortest-Path-01.md)
- [单源最短路径知识(二)](./Contents/08.Graph/04.Graph-Shortest-Path/02.Graph-Single-Source-Shortest-Path-02.md)
- [单源最短路径题目](./Contents/08.Graph/04.Graph-Shortest-Path/03.Graph-Single-Source-Shortest-Path-List.md)
- [多源最短路径知识](./Contents/08.Graph/04.Graph-Shortest-Path/04.Graph-Multi-Source-Shortest-Path.md)
- [多源最短路径题目](./Contents/08.Graph/04.Graph-Shortest-Path/05.Graph-Multi-Source-Shortest-Path-List.md)
- [次短路径知识](./Contents/08.Graph/04.Graph-Shortest-Path/06.Graph-The-Second-Shortest-Path.md)
- [次短路径题目](./Contents/08.Graph/04.Graph-Shortest-Path/07.Graph-The-Second-Shortest-Path-List.md)
- [差分约束系统知识](./Contents/08.Graph/04.Graph-Shortest-Path/08.Graph-System-Of-Difference-Constraints.md)
- [差分约束系统题目](./Contents/08.Graph/04.Graph-Shortest-Path/09.Graph-System-Of-Difference-Constraints-List.md)
- 二分图
- [二分图基础知识](./Contents/08.Graph/05.Graph-Bipartite/01.Graph-Bipartite-Basic.md)
- [二分图基础题目](./Contents/08.Graph/05.Graph-Bipartite/02.Graph-Bipartite-Basic-List.md)
- [二分图最大匹配知识](./Contents/08.Graph/05.Graph-Bipartite/03.Graph-Bipartite-Matching.md)
- [匈牙利算法](./Contents/08.Graph/05.Graph-Bipartite/04.Graph-Hungarian-Algorithm.md)
- [Hopcroft-Karp 算法](./Contents/08.Graph/05.Graph-Bipartite/05.Graph-Hopcroft-Karp.md)
- [二分图最大匹配题目](./Contents/08.Graph/05.Graph-Bipartite/06.Graph-Bipartite-Matching-List.md)

### 09. 基础算法

- 枚举算法
- [枚举算法知识](./Contents/09.Algorithm-Base/01.Enumeration-Algorithm/01.Enumeration-Algorithm.md)
- [枚举算法题目](./Contents/09.Algorithm-Base/01.Enumeration-Algorithm/02.Enumeration-Algorithm-List.md)
- 递归算法
- [递归算法知识](./Contents/09.Algorithm-Base/02.Recursive-Algorithm/01.Recursive-Algorithm.md)
- [递归算法题目](./Contents/09.Algorithm-Base/02.Recursive-Algorithm/02.Recursive-Algorithm-List.md)
- 分治算法
- [分治算法知识](./Contents/09.Algorithm-Base/03.Divide-And-Conquer-Algorithm/01.Divide-And-Conquer-Algorithm.md)
- [分治算法题目](./Contents/09.Algorithm-Base/03.Divide-And-Conquer-Algorithm/02.Divide-And-Conquer-Algorithm-List.md)
- 回溯算法
- [回溯算法知识](./Contents/09.Algorithm-Base/04.Backtracking-Algorithm/01.Backtracking-Algorithm.md)
- [回溯算法题目](./Contents/09.Algorithm-Base/04.Backtracking-Algorithm/02.Backtracking-Algorithm-List.md)
- 贪心算法
- [贪心算法知识](./Contents/09.Algorithm-Base/05.Greedy-Algorithm/01.Greedy-Algorithm.md)
- [贪心算法题目](./Contents/09.Algorithm-Base/05.Greedy-Algorithm/02.Greedy-Algorithm-List.md)
- 位运算
- [位运算知识](./Contents/09.Algorithm-Base/06.Bit-Operation/01.Bit-Operation.md)
- [位运算题目](./Contents/09.Algorithm-Base/06.Bit-Operation/02.Bit-Operation-List.md)

### 10. 动态规划

- 动态规划基础
- [动态规划基础知识](./Contents/10.Dynamic-Programming/01.Dynamic-Programming-Basic/01.Dynamic-Programming-Basic.md)
- [动态规划基础题目](./Contents/10.Dynamic-Programming/01.Dynamic-Programming-Basic/02.Dynamic-Programming-Basic-List.md)
- 记忆化搜索
- [记忆化搜索知识](./Contents/10.Dynamic-Programming/02.Memoization/01.Memoization.md)
- [记忆化搜索题目](./Contents/10.Dynamic-Programming/02.Memoization/02.Memoization-List.md)
- 线性 DP
- [线性 DP 知识(一)](./Contents/10.Dynamic-Programming/03.Linear-DP/01.Linear-DP-01.md)
- [线性 DP 知识(二)](./Contents/10.Dynamic-Programming/03.Linear-DP/02.Linear-DP-02.md)
- [线性 DP 题目](./Contents/10.Dynamic-Programming/03.Linear-DP/03.Linear-DP-List.md)
- 背包问题
- [背包问题知识(一)](./Contents/10.Dynamic-Programming/04.Knapsack-Problem/01.Knapsack-Problem-01.md)
- [背包问题知识(二)](./Contents/10.Dynamic-Programming/04.Knapsack-Problem/02.Knapsack-Problem-02.md)
- [背包问题知识(三)](./Contents/10.Dynamic-Programming/04.Knapsack-Problem/03.Knapsack-Problem-03.md)
- [背包问题知识(四)](./Contents/10.Dynamic-Programming/04.Knapsack-Problem/04.Knapsack-Problem-04.md)
- [背包问题知识(五)](./Contents/10.Dynamic-Programming/04.Knapsack-Problem/05.Knapsack-Problem-05.md)
- [背包问题题目](./Contents/10.Dynamic-Programming/04.Knapsack-Problem/06.Knapsack-Problem-List.md)
- 区间 DP
- [区间 DP 知识](./Contents/10.Dynamic-Programming/05.Interval-DP/01.Interval-DP.md)
- [区间 DP 题目](./Contents/10.Dynamic-Programming/05.Interval-DP/02.Interval-DP-List.md)
- 树形 DP
- [树形 DP 知识](./Contents/10.Dynamic-Programming/06.Tree-DP/01.Tree-DP.md)
- [树形 DP 题目](./Contents/10.Dynamic-Programming/06.Tree-DP/02.Tree-DP-List.md)
- 状态压缩 DP
- [状态压缩 DP 知识](./Contents/10.Dynamic-Programming/07.State-DP/01.State-DP.md)
- [状态压缩 DP 题目](./Contents/10.Dynamic-Programming/07.State-DP/02.State-DP-List.md)
- 计数 DP
- [计数 DP 知识](./Contents/10.Dynamic-Programming/08.Counting-DP/01.Counting-DP.md)
- [计数 DP 题目](./Contents/10.Dynamic-Programming/08.Counting-DP/02.Counting-DP-List.md)
- 数位 DP
- [数位 DP 知识](./Contents/10.Dynamic-Programming/09.Digit-DP/01.Digit-DP.md)
- [数位 DP 题目](./Contents/10.Dynamic-Programming/09.Digit-DP/02.Digit-DP-List.md)
- 概率 DP
- [概率 DP 知识](./Contents/10.Dynamic-Programming/10.Probability-DP/01.Probability-DP.md)
- [概率 DP 题目](./Contents/10.Dynamic-Programming/10.Probability-DP/02.Probability-DP-List.md)
- 动态规划优化
- [单调栈 / 优先队列优化](./Contents/10.Dynamic-Programming/11.DP-Optimization/01.Monotone-Stack-Queue-Optimization.md)
- [斜率优化](./Contents/10.Dynamic-Programming/11.DP-Optimization/02.Slope-Optimization.md)
- [四边形不等式优化](./Contents/10.Dynamic-Programming/11.DP-Optimization/03.Quadrangle-Optimization.md)
- [动态规划优化题目](./Contents/10.Dynamic-Programming/11.DP-Optimization/04.DP-Optimization-List.md)

### 11. 附加内容

- [内容完成时间线](./Contents/Others/Update-Time.md)
### [12. LeetCode 题解(已完成 860 道)](./Contents/00.Introduction/04.Solutions-List.md)