Files
leetcode-master/README.md
youngyangyang04 32736f2615 update readme
2025-09-30 15:29:42 +08:00

270 lines
12 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 代码随想录 · LeetCode-Master
<p align="center">
<a href="https://keetcoder.com/">🌍 海外英文版</a> ·
<a href="https://github.com/youngyangyang04/keetcoder">🌍🇸 英文仓库</a> ·
<a href="https://programmercarl.com/">🇨🇳 国内在线阅读</a> ·
<a href="https://gitee.com/programmercarl/leetcode-master">🇨 Gitee 同步</a>
</p>
<p align="center">
<a href="https://github.com/youngyangyang04/leetcode-master/stargazers"><img alt="stars" src="https://img.shields.io/github/stars/youngyangyang04/leetcode-master?style=flat&label=Stars"></a>
<a href="https://github.com/youngyangyang04/leetcode-master/network/members"><img alt="forks" src="https://img.shields.io/github/forks/youngyangyang04/leetcode-master?style=flat&label=Forks"></a>
<a href="https://github.com/youngyangyang04/leetcode-master/issues"><img alt="issues" src="https://img.shields.io/github/issues/youngyangyang04/leetcode-master?style=flat&label=Issues"></a>
<a href="https://github.com/youngyangyang04/leetcode-master/graphs/contributors"><img alt="contributors" src="https://img.shields.io/github/contributors/youngyangyang04/leetcode-master?style=flat&label=Contributors"></a>
</p>
> 一套 **循序渐进**、**少走弯路** 的刷题计划。
> 题目已按知识脉络与难度 **排好顺序**,每题配 **图文题解 + 视频讲解**。
> 适合从零到进阶、系统化掌握数据结构与算法。
---
## 🔗 快速入口
- 📘 **出版书籍**[《代码随想录》](https://union-click.jd.com/jdc?e=618%7Cpc%7C&p=JF8BASMJK1olXwABU1pUCU0SCl8IGV8WVAICU24ZVxNJXF9RXh5UHw0cSgYYXBcIWDoXSQVJQwYAUF1UDEsQHDZNRwYlVEBGPAIccE51dQ1cfjpVCnsHUjYbTkcbM244GFIXWQYAUV5VOHsXBF9adYOj696n5UKJosTCi_g4GmsVWwILVFhZCUIXBWgMK1wVVDZfHAIVXwAnM18LK1wVVBIEJh8PHE1lM18IK1glXQcCVVpYDU8RB2YUG18QXA4BSF5bDEIXBWsJHlgVXAEyVl9cDEInM7GFqyYQWHkHVBY1TUxoBmZtXT7L0LYTKClfCkMWEl8BGCMVCkFGBg01Dg5zSgcJUCxeD2AKNRwzChFKfGx3HQtCDnN3XV0aDB1KM2o4G10VXzY)
- 🧾 **PDF 精讲**[算法精讲 PDF](https://programmercarl.com/qita/algo_pdf.html)
- 🎬 **算法公开课**[170期硬核视频](https://www.bilibili.com/video/BV1fA4y1o715)
- 🧠 **卡码笔记**[最强八股文](https://notes.kamacoder.com/)
- 👥 **学习社区**:项目 / 面经 / 学习方法 / 面试技巧 → 加入 [「代码随想录」知识星球](https://programmercarl.com/other/kstar.html)
- 🤝 **参与贡献**:本仓讲解以 C++ 为主,含 Java / Python / Go / JS 多语言实现。想点亮头像 👉 [如何提交代码](https://www.programmercarl.com/qita/join.html) · [致谢贡献者](https://github.com/youngyangyang04/leetcode-master/graphs/contributors)
- 📢 **转载须知**:全部为原创,引用请标注来源;恶意搬运将依法维权。
---
## 📚 为什么选这套刷题路线?
- **不再海选题目**README 就是刷题路线,**按顺序刷**即可。
- **全链路学习体验**:每个专题含「理论基础 → 实战题目 → 总结复盘」。
- **经典高频必会**:题目均为**高频面试题**与**典型考点**。
- **多语言覆盖**:除 C++ 主线,还有社区贡献的多语言实现。
<p align="center">
<a href="https://programmercarl.com/xunlian/xunlianying.html" target="_blank">
<img src="./pics/训练营.png" width="800" />
</a>
</p>
---
## 🚀 如何使用本攻略
1. **从头开始**:按模块顺序「数组 → 链表 → 哈希表 → … → 图论」。
2. **带着问题学**:每个模块先看「理论基础」,再刷对应题单。
3. **及时复盘**:刷完一个模块,阅读「总结篇」,形成**知识闭环**。
4. **语言不设限**:题解以 C++ 讲解为主,配多语言代码,思路通用。
> **建议**:新手先刷「数组/链表/哈希/字符串」,再进阶到「二叉树/回溯/贪心/动态规划/图论」。
---
## 🧭 刷题总目录(可折叠)
> 已根据学习曲线优化排序;下方仅展示每章前若干题目,完整清单请展开查看。
<details>
<summary><b>前序 · 打基础</b></summary>
- [做项目C++ / Java / Go / 前端 / 测开)](https://programmercarl.com/other/kstar.html)
- 编程语言
- [C++ 面试与学习指南](https://github.com/youngyangyang04/TechCPP)
- [语言基础课](https://programmercarl.com/qita/language.html)
- [23 种设计模式](https://programmercarl.com/ke/shejimoshi.html)
- [大厂算法笔试题](https://programmercarl.com/ke/bishi.html)
- 工具
- [一站式 Vim 配置](https://github.com/youngyangyang04/PowerVim)
- [万字 Git 入门](https://mp.weixin.qq.com/s/Q_O0ey4C9tryPZaZeJocbA)
- [程序员写文档用什么?](./problems/前序/程序员写文档工具.md)
- 求职
- [卡码网ACM 模式练习)](https://kamacoder.com/)
- [简历怎么写(含模板)](./problems/前序/程序员简历.md)
- [专业技能怎么写](https://programmercarl.com/other/jianlizhuanye.html)
- [项目经历怎么写](https://programmercarl.com/other/jianlixiangmu.html)
- [BAT 面试流程与注意事项](./problems/前序/BAT级别技术面试流程和注意事项都在这里了.md)
- 算法性能分析
- [时间复杂度全解](./problems/前序/时间复杂度.md)
- [O(n) 也会超时?](./problems/前序/算法超时.md)
- [递归的时空复杂度](./problems/前序/递归算法的时间复杂度.md)
- [空间复杂度常见疑问](./problems/前序/空间复杂度.md)
- [内存消耗那些事](./problems/前序/内存消耗.md)
</details>
<details>
<summary><b>数组</b></summary>
- [数组理论基础](./problems/数组理论基础.md)
- [704. 二分查找](./problems/0704.二分查找.md)
- [27. 移除元素](./problems/0027.移除元素.md)
- [977. 有序数组的平方](./problems/0977.有序数组的平方.md)
- [209. 长度最小的子数组](./problems/0209.长度最小的子数组.md)
- [59. 螺旋矩阵 II](./problems/0059.螺旋矩阵II.md)
- [数组总结篇](./problems/数组总结篇.md)
</details>
<details>
<summary><b>链表</b></summary>
- [链表理论基础](./problems/链表理论基础.md)
- [203. 移除链表元素](./problems/0203.移除链表元素.md)
- [707. 设计链表](./problems/0707.设计链表.md)
- [206. 反转链表](./problems/0206.翻转链表.md)
- [142. 环形链表 II](./problems/0142.环形链表II.md)
- [链表总结篇](./problems/链表总结篇.md)
</details>
<details>
<summary><b>哈希表</b></summary>
- [哈希表理论基础](./problems/哈希表理论基础.md)
- [242. 有效的字母异位词](./problems/0242.有效的字母异位词.md)
- [1. 两数之和](./problems/0001.两数之和.md)
- [15. 三数之和](./problems/0015.三数之和.md)
- [哈希表总结篇](./problems/哈希表总结.md)
</details>
<details>
<summary><b>字符串</b></summary>
- [344. 反转字符串](./problems/0344.反转字符串.md)
- [151. 翻转字符串里的单词](./problems/0151.翻转字符串里的单词.md)
- [KMP 通关](./problems/0028.实现strStr.md)
- [459. 重复的子字符串](./problems/0459.重复的子字符串.md)
- [字符串总结篇](./problems/字符串总结.md)
</details>
<details>
<summary><b>双指针法</b></summary>
- [数组 · 27. 移除元素](./problems/0027.移除元素.md)
- [链表 · 19. 删除倒数第 N 个](./problems/0019.删除链表的倒数第N个节点.md)
- [15. 三数之和](./problems/0015.三数之和.md)
- [18. 四数之和](./problems/0018.四数之和.md)
- [双指针总结篇](./problems/双指针总结.md)
</details>
<details>
<summary><b>栈与队列</b></summary>
- [理论基础](./problems/栈与队列理论基础.md)
- [232. 用栈实现队列](./problems/0232.用栈实现队列.md)
- [20. 有效的括号](./problems/0020.有效的括号.md)
- [239. 滑动窗口最大值](./problems/0239.滑动窗口最大值.md)
- [347. 前 K 个高频元素](./problems/0347.前K个高频元素.md)
- [总结篇](./problems/栈与队列总结.md)
</details>
<details>
<summary><b>二叉树</b></summary>
- [二叉树理论基础](./problems/二叉树理论基础.md)
- [递归遍历 / 迭代遍历 / 统一迭代](./problems/二叉树的递归遍历.md)
- [102. 层序遍历](./problems/0102.二叉树的层序遍历.md)
- [226. 翻转二叉树](./problems/0226.翻转二叉树.md)
- [98. 验证二叉搜索树](./problems/0098.验证二叉搜索树.md)
- [236. 最近公共祖先](./problems/0236.二叉树的最近公共祖先.md)
- [二叉树总结篇](./problems/二叉树总结篇.md)
</details>
<details>
<summary><b>回溯算法</b></summary>
- [回溯理论基础](./problems/回溯算法理论基础.md)
- [77. 组合 / 优化](./problems/0077.组合.md)
- [39/40. 组合总和I/II](./problems/0039.组合总和.md)
- [46/47. 全排列I/II](./problems/0046.全排列.md)
- [51. N 皇后 · 37. 解数独](./problems/0051.N皇后.md)
- [回溯总结篇](./problems/回溯总结.md)
</details>
<details>
<summary><b>贪心算法</b></summary>
- [贪心理论基础](./problems/贪心算法理论基础.md)
- [455. 分发饼干](./problems/0455.分发饼干.md)
- [53. 最大子序和](./problems/0053.最大子序和.md)
- [55/45. 跳跃游戏I/II](./problems/0055.跳跃游戏.md)
- [134. 加油站 / 135. 分发糖果](./problems/0134.加油站.md)
- [贪心总结篇](./problems/贪心算法总结篇.md)
</details>
<details>
<summary><b>动态规划</b></summary>
- [动规总览与思维方式](./problems/动态规划理论基础.md)
- 入门509. 斐波那契 · 70. 爬楼梯 · 746. 使用最小花费爬楼梯
- 经典62/63. 不同路径 · 322. 零钱兑换 · 279. 完全平方数
- 背包01/完全/多重背包与模板、子集和、组合数
- 股票121/122/123/188/309/714 系列
- 子序列300 LIS、1143 LCS、72 编辑距离、516 最长回文子序列
- [背包总结篇](./problems/背包总结篇.md) · [股票总结篇](./problems/动态规划-股票问题总结篇.md) · [动规总结篇](./problems/动态规划总结篇.md)
</details>
<details>
<summary><b>单调栈</b></summary>
- [739. 每日温度](./problems/0739.每日温度.md)
- [496/503. 下一个更大元素 I/II](./problems/0496.下一个更大元素I.md)
- [42. 接雨水 · 84. 柱状图最大矩形](./problems/0042.接雨水.md)
</details>
<details>
<summary><b>图论</b></summary>
- [图论发布说明](./problems/qita/tulunfabu.md)
- 搜索DFS / BFS、岛屿问题系列、可达性
- 并查集:冗余连接 I/II、连通性判定
- 最小生成树Prim / Kruskal
- 最短路Dijkstra朴素/堆)· Bellman-Ford · SPFA · Floyd · A*
- [最短路总结篇](./problems/kamacoder/最短路问题总结篇.md) · [图论总结篇](./problems/kamacoder/图论总结篇.md)
</details>
---
## 🧩 算法模板
- [各类基础算法模板(持续更新)](https://github.com/youngyangyang04/leetcode/blob/master/problems/算法模板.md)
---
## 🙌 参与贡献
- 欢迎提交 **题解修订 / 多语言实现 / 文档勘误 / 新增练习**
- 请先阅读:[如何提交与协作](https://www.programmercarl.com/qita/join.html)
- 致谢所有贡献者 → [Contributors](https://github.com/youngyangyang04/leetcode-master/graphs/contributors)
---
## ⭐ Star 趋势
[![Star History Chart](https://api.star-history.com/svg?repos=youngyangyang04/leetcode-master&type=Date)](https://star-history.com/#youngyangyang04/leetcode-master&Date)
---
## 👨‍💻 关于作者
大家好,我是 **程序员 Carl**,哈工大师兄,先后在腾讯、百度从事后端与底层技术研发,著有《代码随想录》。
---
## 📥 PDF 下载与学习群
添加下方企业微信,自动获取 **PDF 精讲**,并可选择加入刷题群:
> 备注格式
> - **在职**:姓名-城市-岗位
> - **学生**:姓名-学校-年级(**无备注不通过**
<p align="center">
<img src="https://file1.kamacoder.com/i/algo/shuati20250519.jpg" width="200" height="200" />
</p>
---
## 📜 版权说明
- 本仓库所有内容均为原创,引用需 **注明出处与链接**
- 严禁恶意搬运与洗稿,侵权必究。
---