提交 fbd5affb 编写于 作者: L labuladong

修正url

上级 af6787e6
pictures/qrcode.jpg

17.2 KB | W: | H:

pictures/qrcode.jpg

26.6 KB | W: | H:

pictures/qrcode.jpg
pictures/qrcode.jpg
pictures/qrcode.jpg
pictures/qrcode.jpg
  • 2-up
  • Swipe
  • Onion skin
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [经典动态规划:最长公共子序列](https://labuladong.gitbook.io/algo)
* [特殊数据结构:单调栈](https://labuladong.gitbook.io/algo)
* [经典动态规划:最长公共子序列](https://labuladong.gitbook.io/algo/)
* [特殊数据结构:单调栈](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -423,7 +423,7 @@ KMP 算法也就是动态规划那点事,我们的公众号文章目录有一
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [40张图解:TCP三次握手和四次挥手面试题](https://labuladong.gitbook.io/algo)
* [如何计算完全二叉树的节点数](https://labuladong.gitbook.io/algo)
* [40张图解:TCP三次握手和四次挥手面试题](https://labuladong.gitbook.io/algo/)
* [如何计算完全二叉树的节点数](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -20,7 +20,7 @@
**-----------**
上一篇文章 [几道智力题](https://labuladong.gitbook.io/algo) 中讨论到一个有趣的「石头游戏」,通过题目的限制条件,这个游戏是先手必胜的。但是智力题终究是智力题,真正的算法问题肯定不会是投机取巧能搞定的。所以,本文就借石头游戏来讲讲「假设两个人都足够聪明,最后谁会获胜」这一类问题该如何用动态规划算法解决。
上一篇文章 [几道智力题](https://labuladong.gitbook.io/algo/) 中讨论到一个有趣的「石头游戏」,通过题目的限制条件,这个游戏是先手必胜的。但是智力题终究是智力题,真正的算法问题肯定不会是投机取巧能搞定的。所以,本文就借石头游戏来讲讲「假设两个人都足够聪明,最后谁会获胜」这一类问题该如何用动态规划算法解决。
博弈类问题的套路都差不多,下文参考 [这个 YouTube 视频](https://www.youtube.com/watch?v=WxpIHvsu1RI) 的思路讲解,其核心思路是在二维 dp 的基础上使用元组分别存储两个人的博弈结果。掌握了这个技巧以后,别人再问你什么俩海盗分宝石,俩人拿硬币的问题,你就告诉别人:我懒得想,直接给你写个算法算一下得了。
......@@ -207,7 +207,7 @@ int stoneGame(int[] piles) {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [如何高效寻找素数](https://labuladong.gitbook.io/algo)
* [动态规划解题套路框架](https://labuladong.gitbook.io/algo)
* [如何高效寻找素数](https://labuladong.gitbook.io/algo/)
* [动态规划解题套路框架](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -192,7 +192,7 @@ def dp(n, a_num, copy):
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -10,8 +10,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [我写了首诗,把滑动窗口算法算法变成了默写题](https://labuladong.gitbook.io/algo)
* [二分查找高效判定子序列](https://labuladong.gitbook.io/algo)
* [我写了首诗,把滑动窗口算法算法变成了默写题](https://labuladong.gitbook.io/algo/)
* [二分查找高效判定子序列](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -287,7 +287,7 @@ bool dp(string& s, int i, string& p, int j) {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -10,8 +10,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [动态规划设计:最大子数组](https://labuladong.gitbook.io/algo)
* [一文学会递归解题](https://labuladong.gitbook.io/algo)
* [动态规划设计:最大子数组](https://labuladong.gitbook.io/algo/)
* [一文学会递归解题](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -19,7 +19,7 @@
**-----------**
也许有读者看了前文 [动态规划详解](https://labuladong.gitbook.io/algo),学会了动态规划的套路:找到了问题的「状态」,明确了 `dp` 数组/函数的含义,定义了 base case;但是不知道如何确定「选择」,也就是不到状态转移的关系,依然写不出动态规划解法,怎么办?
也许有读者看了前文 [动态规划详解](https://labuladong.gitbook.io/algo/),学会了动态规划的套路:找到了问题的「状态」,明确了 `dp` 数组/函数的含义,定义了 base case;但是不知道如何确定「选择」,也就是不到状态转移的关系,依然写不出动态规划解法,怎么办?
不要担心,动态规划的难点本来就在于寻找正确的状态转移方程,本文就借助经典的「最长递增子序列问题」来讲一讲设计动态规划的通用技巧:**数学归纳思想**
......@@ -43,7 +43,7 @@
**我们的定义是这样的:`dp[i]` 表示以 `nums[i]` 这个数结尾的最长递增子序列的长度。**
PS:为什么这样定义呢?这是解决子序列问题的一个套路,后文[动态规划之子序列问题解题模板](https://labuladong.gitbook.io/algo) 总结了几种常见套路。你读完本章所有的动态规划问题,就会发现 `dp` 数组的定义方法也就那几种。
PS:为什么这样定义呢?这是解决子序列问题的一个套路,后文[动态规划之子序列问题解题模板](https://labuladong.gitbook.io/algo/) 总结了几种常见套路。你读完本章所有的动态规划问题,就会发现 `dp` 数组的定义方法也就那几种。
根据这个定义,我们就可以推出 base case:`dp[i]` 初始值为 1,因为以 `nums[i]` 结尾的最长递增子序列起码要包含它自己。
......@@ -164,7 +164,7 @@ public int lengthOfLIS(int[] nums) {
我们只要把处理扑克牌的过程编程写出来即可。每次处理一张扑克牌不是要找一个合适的牌堆顶来放吗,牌堆顶的牌不是**有序**吗,这就能用到二分查找了:用二分查找来搜索当前牌应放置的位置。
PS:旧文[二分查找算法详解](https://labuladong.gitbook.io/algo)详细介绍了二分查找的细节及变体,这里就完美应用上了,如果没读过强烈建议阅读。
PS:旧文[二分查找算法详解](https://labuladong.gitbook.io/algo/)详细介绍了二分查找的细节及变体,这里就完美应用上了,如果没读过强烈建议阅读。
```java
public int lengthOfLIS(int[] nums) {
......@@ -207,7 +207,7 @@ public int lengthOfLIS(int[] nums) {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [经典动态规划:完全背包问题](https://labuladong.gitbook.io/algo)
* [Git/SQL/正则表达式的在线练习平台](https://labuladong.gitbook.io/algo)
* [经典动态规划:完全背包问题](https://labuladong.gitbook.io/algo/)
* [Git/SQL/正则表达式的在线练习平台](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -216,7 +216,7 @@ int coinChange(int[] coins, int amount);
回到凑零钱问题,为什么说它符合最优子结构呢?比如你想求 `amount = 11` 时的最少硬币数(原问题),如果你知道凑出 `amount = 10` 的最少硬币数(子问题),你只需要把子问题的答案加一(再选一枚面值为 1 的硬币)就是原问题的答案。因为硬币的数量是没有限制的,所以子问题之间没有相互制,是互相独立的。
PS:关于最优子结构的问题,后文[动态规划答疑篇](https://labuladong.gitbook.io/algo) 还会再举例探讨。
PS:关于最优子结构的问题,后文[动态规划答疑篇](https://labuladong.gitbook.io/algo/) 还会再举例探讨。
那么,既然知道了这是个动态规划问题,就要思考**如何列出正确的状态转移方程**
......@@ -360,7 +360,7 @@ PS:为啥 `dp` 数组初始化为 `amount + 1` 呢,因为凑成 `amount` 金
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [动态规划之KMP字符匹配算法](https://labuladong.gitbook.io/algo)
* [如何判断回文链表](https://labuladong.gitbook.io/algo)
* [动态规划之KMP字符匹配算法](https://labuladong.gitbook.io/algo/)
* [如何判断回文链表](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -420,7 +420,7 @@ int maxProfit_k_any(int max_k, int[] prices) {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -12,8 +12,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [洗牌算法](https://labuladong.gitbook.io/algo)
* [twoSum问题的核心思想](https://labuladong.gitbook.io/algo)
* [洗牌算法](https://labuladong.gitbook.io/algo/)
* [twoSum问题的核心思想](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -166,7 +166,7 @@ int longestPalindromeSubseq(string s) {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,labuladong 带你搞定 LeetCode**
......
......@@ -10,7 +10,7 @@
![](../pictures/souyisou.png)
相关推荐:
* [动态规划之四键键盘](https://labuladong.gitbook.io/algo)
* [动态规划之四键键盘](https://labuladong.gitbook.io/algo/)
* [经典动态规划:子集背包问题](/https://labuladong.gitbook.io/algo)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -250,7 +250,7 @@ int[] dp(TreeNode root) {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -12,8 +12,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [搜索引擎背后的经典数据结构和算法](https://labuladong.gitbook.io/algo)
* [动态规划之四键键盘](https://labuladong.gitbook.io/algo)
* [搜索引擎背后的经典数据结构和算法](https://labuladong.gitbook.io/algo/)
* [动态规划之四键键盘](https://labuladong.gitbook.io/algo/)
**-----------**
......@@ -54,7 +54,7 @@ return result;
当然,上面这个例子太简单了,不过请读者回顾一下,我们做动态规划问题,是不是一直在求各种最值,本质跟我们举的例子没啥区别,无非需要处理一下重叠子问题。
前文不[同定义不同解法](https://labuladong.gitbook.io/algo)[高楼扔鸡蛋进阶](https://labuladong.gitbook.io/algo) 就展示了如何改造问题,不同的最优子结构,可能导致不同的解法和效率。
前文不[同定义不同解法](https://labuladong.gitbook.io/algo/)[高楼扔鸡蛋进阶](https://labuladong.gitbook.io/algo/) 就展示了如何改造问题,不同的最优子结构,可能导致不同的解法和效率。
再举个常见但也十分简单的例子,求一棵二叉树的最大值,不难吧(简单起见,假设节点中的值都是非负数):
......@@ -149,7 +149,7 @@ for (int i = 1; i < m; i++)
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [回溯算法解题套路框架](https://labuladong.gitbook.io/algo)
* [经典动态规划:高楼扔鸡蛋(进阶)](https://labuladong.gitbook.io/algo)
* [回溯算法解题套路框架](https://labuladong.gitbook.io/algo/)
* [经典动态规划:高楼扔鸡蛋(进阶)](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -139,7 +139,7 @@ else:
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [labuladong优质作者扶持计划](https://labuladong.gitbook.io/algo)
* [动态规划设计:最大子数组](https://labuladong.gitbook.io/algo)
* [labuladong优质作者扶持计划](https://labuladong.gitbook.io/algo/)
* [动态规划设计:最大子数组](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -283,7 +283,7 @@ class Node {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [如何判定括号合法性](https://labuladong.gitbook.io/algo)
* [一文解决三道区间问题](https://labuladong.gitbook.io/algo)
* [如何判定括号合法性](https://labuladong.gitbook.io/algo/)
* [一文解决三道区间问题](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -150,7 +150,7 @@ int findMinArrowShots(int[][] intvs) {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [手把手带你刷二叉树(第二期)](https://labuladong.gitbook.io/algo)
* [状态压缩:对动态规划进行降维打击](https://labuladong.gitbook.io/algo)
* [手把手带你刷二叉树(第二期)](https://labuladong.gitbook.io/algo/)
* [状态压缩:对动态规划进行降维打击](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -287,7 +287,7 @@ while (lo < hi) {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -12,8 +12,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [如何判断回文链表](https://labuladong.gitbook.io/algo)
* [SQL进阶技巧](https://labuladong.gitbook.io/algo)
* [如何判断回文链表](https://labuladong.gitbook.io/algo/)
* [SQL进阶技巧](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -243,7 +243,7 @@ def superEggDrop(self, K: int, N: int) -> int:
return dp(K, N)
```
这里就不展开其他解法了,留在下一篇文章 [高楼扔鸡蛋进阶](https://labuladong.gitbook.io/algo)
这里就不展开其他解法了,留在下一篇文章 [高楼扔鸡蛋进阶](https://labuladong.gitbook.io/algo/)
我觉得吧,我们这种解法就够了:找状态,做选择,足够清晰易懂,可流程化,可举一反三。掌握这套框架学有余力的话,再去考虑那些奇技淫巧也不迟。
......@@ -253,7 +253,7 @@ def superEggDrop(self, K: int, N: int) -> int:
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [状态压缩:对动态规划进行降维打击](https://labuladong.gitbook.io/algo)
* [我用四个命令概括了 Git 的所有套路](https://labuladong.gitbook.io/algo)
* [状态压缩:对动态规划进行降维打击](https://labuladong.gitbook.io/algo/)
* [我用四个命令概括了 Git 的所有套路](https://labuladong.gitbook.io/algo/)
**-----------**
......@@ -149,7 +149,7 @@ $ sudo /home/fdl/bin/connect.sh
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [一文解决三道区间问题](https://labuladong.gitbook.io/algo)
* [Union-Find算法详解](https://labuladong.gitbook.io/algo)
* [一文解决三道区间问题](https://labuladong.gitbook.io/algo/)
* [Union-Find算法详解](https://labuladong.gitbook.io/algo/)
**-----------**
......@@ -133,7 +133,7 @@ $ cmd1 | cmd2 | cmd3
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [烧饼排序](https://labuladong.gitbook.io/algo)
* [动态规划之正则表达](https://labuladong.gitbook.io/algo)
* [烧饼排序](https://labuladong.gitbook.io/algo/)
* [动态规划之正则表达](https://labuladong.gitbook.io/algo/)
**-----------**
......@@ -98,7 +98,7 @@ Redis 监听的默认端口是 6379,我们设置它接收网卡 127.0.0.1 的
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [如何计算完全二叉树的节点数](https://labuladong.gitbook.io/algo)
* [Linux的进程、线程、文件描述符是什么](https://labuladong.gitbook.io/algo)
* [如何计算完全二叉树的节点数](https://labuladong.gitbook.io/algo/)
* [Linux的进程、线程、文件描述符是什么](https://labuladong.gitbook.io/algo/)
**-----------**
......@@ -147,7 +147,7 @@ https://github.com/astaxie/build-web-application-with-golang
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [区间调度之区间合并问题](https://labuladong.gitbook.io/algo)
* [别再说你不懂Linux内存管理了,10张图给你安排的明明白白](https://labuladong.gitbook.io/algo)
* [区间调度之区间合并问题](https://labuladong.gitbook.io/algo/)
* [别再说你不懂Linux内存管理了,10张图给你安排的明明白白](https://labuladong.gitbook.io/algo/)
**-----------**
......@@ -111,7 +111,7 @@ https://sqlzoo.net/
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [我用四个命令概括了 Git 的所有套路](https://labuladong.gitbook.io/algo)
* [一个方法团灭 nSum 问题](https://labuladong.gitbook.io/algo)
* [我用四个命令概括了 Git 的所有套路](https://labuladong.gitbook.io/algo/)
* [一个方法团灭 nSum 问题](https://labuladong.gitbook.io/algo/)
**-----------**
......@@ -194,7 +194,7 @@ HTTPS 协议中的 SSL/TLS 安全层会组合使用以上几种加密方式,**
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......@@ -203,4 +203,4 @@ HTTPS 协议中的 SSL/TLS 安全层会组合使用以上几种加密方式,**
</p>
======其他语言代码======
[test ad](https://labuladong.gitbook.io/algo)
\ No newline at end of file
[test ad](https://labuladong.gitbook.io/algo/)
\ No newline at end of file
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [算法就像搭乐高:带你手撸 LRU 算法](https://labuladong.gitbook.io/algo)
* [拆解复杂问题:实现计算器](https://labuladong.gitbook.io/algo)
* [算法就像搭乐高:带你手撸 LRU 算法](https://labuladong.gitbook.io/algo/)
* [拆解复杂问题:实现计算器](https://labuladong.gitbook.io/algo/)
**-----------**
......@@ -231,7 +231,7 @@ public Key delMax() {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [特殊数据结构:单调队列](https://labuladong.gitbook.io/algo)
* [一行代码就能解决的算法题](https://labuladong.gitbook.io/algo)
* [特殊数据结构:单调队列](https://labuladong.gitbook.io/algo/)
* [一行代码就能解决的算法题](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -28,7 +28,7 @@
**-----------**
通过之前的文章[框架思维](https://labuladong.gitbook.io/algo),二叉树的遍历框架应该已经印到你的脑子里了,这篇文章就来实操一下,看看框架思维是怎么灵活运用,秒杀一切二叉树问题的。
通过之前的文章[框架思维](https://labuladong.gitbook.io/algo/),二叉树的遍历框架应该已经印到你的脑子里了,这篇文章就来实操一下,看看框架思维是怎么灵活运用,秒杀一切二叉树问题的。
二叉树算法的设计的总路线:明确一个节点要做的事情,然后剩下的事抛给框架。
......@@ -302,7 +302,7 @@ void BST(TreeNode root, int target) {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [回溯算法解题套路框架](https://labuladong.gitbook.io/algo)
* [动态规划解题套路框架](https://labuladong.gitbook.io/algo)
* [回溯算法解题套路框架](https://labuladong.gitbook.io/algo/)
* [动态规划解题套路框架](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -173,7 +173,7 @@ vector<int> nextGreaterElements(vector<int>& nums) {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [几个反直觉的概率问题](https://labuladong.gitbook.io/algo)
* [Git/SQL/正则表达式的在线练习平台](https://labuladong.gitbook.io/algo)
* [几个反直觉的概率问题](https://labuladong.gitbook.io/algo/)
* [Git/SQL/正则表达式的在线练习平台](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -202,7 +202,7 @@ vector<int> maxSlidingWindow(vector<int>& nums, int k) {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -12,8 +12,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [特殊数据结构:单调队列](https://labuladong.gitbook.io/algo)
* [一行代码就能解决的算法题](https://labuladong.gitbook.io/algo)
* [特殊数据结构:单调队列](https://labuladong.gitbook.io/algo/)
* [一行代码就能解决的算法题](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -298,7 +298,7 @@ def calculate(s: str) -> int:
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [面试官:你说对MySQL事务很熟?那我问你10个问题](https://labuladong.gitbook.io/algo)
* [一行代码就能解决的算法题](https://labuladong.gitbook.io/algo)
* [面试官:你说对MySQL事务很熟?那我问你10个问题](https://labuladong.gitbook.io/algo/)
* [一行代码就能解决的算法题](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -294,7 +294,7 @@ PS:本文前两张图片和 GIF 是我第一次尝试用平板的绘图软件
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [特殊数据结构:单调队列](https://labuladong.gitbook.io/algo)
* [回溯算法最佳实践:括号生成](https://labuladong.gitbook.io/algo)
* [特殊数据结构:单调队列](https://labuladong.gitbook.io/algo/)
* [回溯算法最佳实践:括号生成](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -210,7 +210,7 @@ ListNode reverseBetween(ListNode head, int m, int n) {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [手把手带你刷二叉树(第三期)](https://labuladong.gitbook.io/algo)
* [高性能短链设计](https://labuladong.gitbook.io/algo)
* [手把手带你刷二叉树(第三期)](https://labuladong.gitbook.io/algo/)
* [高性能短链设计](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -222,7 +222,7 @@ public boolean empty() {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [如何高效进行模幂运算](https://labuladong.gitbook.io/algo)
* [经典动态规划:0-1 背包问题](https://labuladong.gitbook.io/algo)
* [如何高效进行模幂运算](https://labuladong.gitbook.io/algo/)
* [经典动态规划:0-1 背包问题](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -126,7 +126,7 @@ image[x][y] = newColor;
完全 OK,这也是处理「图」的一种常用手段。不过对于此题,不用开数组,我们有一种更好的方法,那就是回溯算法。
前文 [回溯算法框架套路](https://labuladong.gitbook.io/algo)讲过,这里不再赘述,直接套回溯算法框架:
前文 [回溯算法框架套路](https://labuladong.gitbook.io/algo/)讲过,这里不再赘述,直接套回溯算法框架:
```java
void fill(int[][] image, int x, int y,
......@@ -231,7 +231,7 @@ int fill(int[][] image, int x, int y,
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [手把手带你刷二叉树(第一期)](https://labuladong.gitbook.io/algo)
* [二分查找详解](https://labuladong.gitbook.io/algo)
* [手把手带你刷二叉树(第一期)](https://labuladong.gitbook.io/algo/)
* [二分查找详解](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -244,7 +244,7 @@ boolean equationsPossible(String[] equations) {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [一文秒杀四道原地修改数组的算法题](https://labuladong.gitbook.io/algo)
* [学习算法和数据结构的思路指南](https://labuladong.gitbook.io/algo)
* [一文秒杀四道原地修改数组的算法题](https://labuladong.gitbook.io/algo/)
* [学习算法和数据结构的思路指南](https://labuladong.gitbook.io/algo/)
**-----------**
......@@ -309,7 +309,7 @@ Union-Find 算法的复杂度可以这样分析:构造函数初始化数据结
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [我写了首诗,让你闭着眼睛也能写对二分搜索](https://labuladong.gitbook.io/algo)
* [经典动态规划:完全背包问题](https://labuladong.gitbook.io/algo)
* [我写了首诗,让你闭着眼睛也能写对二分搜索](https://labuladong.gitbook.io/algo/)
* [经典动态规划:完全背包问题](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -177,7 +177,7 @@ int[] twoSum(int[] nums, int target) {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [递归反转链表的一部分](https://labuladong.gitbook.io/algo)
* [25 张图解:键入网址后,到网页显示,其间发生了什么](https://labuladong.gitbook.io/algo)
* [递归反转链表的一部分](https://labuladong.gitbook.io/algo/)
* [25 张图解:键入网址后,到网页显示,其间发生了什么](https://labuladong.gitbook.io/algo/)
**-----------**
......@@ -93,7 +93,7 @@
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [手把手带你刷二叉树(第三期)](https://labuladong.gitbook.io/algo)
* [回溯算法解题套路框架](https://labuladong.gitbook.io/algo)
* [手把手带你刷二叉树(第三期)](https://labuladong.gitbook.io/algo/)
* [回溯算法解题套路框架](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -500,7 +500,7 @@ int right_bound(int[] nums, int target) {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [讲两道常考的阶乘算法题](https://labuladong.gitbook.io/algo)
* [状态压缩:对动态规划进行降维打击](https://labuladong.gitbook.io/algo)
* [讲两道常考的阶乘算法题](https://labuladong.gitbook.io/algo/)
* [状态压缩:对动态规划进行降维打击](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -22,7 +22,7 @@
很多算法问题都需要排序技巧,其难点不在于排序本身,而是需要巧妙地排序进行预处理,将算法问题进行转换,为之后的操作打下基础。
信封嵌套问题就需要先按特定的规则排序,之后就转换为一个 [最长递增子序列问题](https://labuladong.gitbook.io/algo),可以用前文 [二分查找详解](https://labuladong.gitbook.io/algo) 的技巧来解决了。
信封嵌套问题就需要先按特定的规则排序,之后就转换为一个 [最长递增子序列问题](https://labuladong.gitbook.io/algo/),可以用前文 [二分查找详解](https://labuladong.gitbook.io/algo/) 的技巧来解决了。
### 一、题目概述
......@@ -127,7 +127,7 @@ public int lengthOfLIS(int[] nums) {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,12 +11,12 @@
![](../pictures/souyisou.png)
相关推荐:
* [学习算法和数据结构的思路指南](https://labuladong.gitbook.io/algo)
* [我写了首诗,让你闭着眼睛也能写对二分搜索](https://labuladong.gitbook.io/algo)
* [学习算法和数据结构的思路指南](https://labuladong.gitbook.io/algo/)
* [我写了首诗,让你闭着眼睛也能写对二分搜索](https://labuladong.gitbook.io/algo/)
**-----------**
上篇文章 [洗牌算法详解](https://labuladong.gitbook.io/algo) 讲到了验证概率算法的蒙特卡罗方法,今天聊点轻松的内容:几个和概率相关的有趣问题。
上篇文章 [洗牌算法详解](https://labuladong.gitbook.io/algo/) 讲到了验证概率算法的蒙特卡罗方法,今天聊点轻松的内容:几个和概率相关的有趣问题。
计算概率有下面两个最简单的原则:
......@@ -133,7 +133,7 @@
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [如何去除有序数组的重复元素](https://labuladong.gitbook.io/algo)
* [区间调度之区间合并问题](https://labuladong.gitbook.io/algo)
* [如何去除有序数组的重复元素](https://labuladong.gitbook.io/algo/)
* [区间调度之区间合并问题](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -151,7 +151,7 @@ for (int i = 1; i < count.length; i++)
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [经典动态规划:编辑距离](https://labuladong.gitbook.io/algo)
* [经典动态规划:高楼扔鸡蛋(进阶)](https://labuladong.gitbook.io/algo)
* [经典动态规划:编辑距离](https://labuladong.gitbook.io/algo/)
* [经典动态规划:高楼扔鸡蛋(进阶)](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -125,7 +125,7 @@ def intervalIntersection(A, B):
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [Git原理之最近公共祖先](https://labuladong.gitbook.io/algo)
* [洗牌算法](https://labuladong.gitbook.io/algo)
* [Git原理之最近公共祖先](https://labuladong.gitbook.io/algo/)
* [洗牌算法](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -83,7 +83,7 @@ def merge(intervals):
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [一文秒杀四道原地修改数组的算法题](https://labuladong.gitbook.io/algo)
* [Linux的进程、线程、文件描述符是什么](https://labuladong.gitbook.io/algo)
* [一文秒杀四道原地修改数组的算法题](https://labuladong.gitbook.io/algo/)
* [Linux的进程、线程、文件描述符是什么](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -221,13 +221,13 @@ void reverse(int[] nums) {
这也许是双指针技巧的最高境界了,如果掌握了此算法,可以解决一大类子字符串匹配的问题,不过「滑动窗口」稍微比上述的这些算法复杂些。
幸运的是,这类算法是有框架模板的,而且[这篇文章](https://labuladong.gitbook.io/algo)就讲解了「滑动窗口」算法模板,帮大家秒杀几道 LeetCode 子串匹配的问题。
幸运的是,这类算法是有框架模板的,而且[这篇文章](https://labuladong.gitbook.io/algo/)就讲解了「滑动窗口」算法模板,帮大家秒杀几道 LeetCode 子串匹配的问题。
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [我写了首诗,把滑动窗口算法算法变成了默写题](https://labuladong.gitbook.io/algo)
* [经典动态规划:高楼扔鸡蛋(进阶)](https://labuladong.gitbook.io/algo)
* [我写了首诗,把滑动窗口算法算法变成了默写题](https://labuladong.gitbook.io/algo/)
* [经典动态规划:高楼扔鸡蛋(进阶)](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -301,7 +301,7 @@ def backtrack(...):
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [关于 Linux shell 你必须知道的](https://labuladong.gitbook.io/algo)
* [回溯算法解题套路框架](https://labuladong.gitbook.io/algo)
* [关于 Linux shell 你必须知道的](https://labuladong.gitbook.io/algo/)
* [回溯算法解题套路框架](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -93,7 +93,7 @@ string multiply(string num1, string num2) {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [twoSum问题的核心思想](https://labuladong.gitbook.io/algo)
* [经典动态规划:高楼扔鸡蛋(进阶)](https://labuladong.gitbook.io/algo)
* [twoSum问题的核心思想](https://labuladong.gitbook.io/algo/)
* [经典动态规划:高楼扔鸡蛋(进阶)](https://labuladong.gitbook.io/algo/)
**-----------**
......@@ -130,7 +130,7 @@ N 叉树的遍历又可以扩展为图的遍历,因为图就是好几 N 叉棵
首先要明确的是,**数据结构是工具,算法是通过合适的工具解决特定问题的方法**。也就是说,学习算法之前,最起码得了解那些常用的数据结构,了解它们的特性和缺陷。
那么该如何在 LeetCode 刷题呢?之前的文章[算法学习之路](https://labuladong.gitbook.io/algo)写过一些,什么按标签刷,坚持下去云云。现在距那篇文章已经过去将近一年了,我不说那些不痛不痒的话,直接说具体的建议:
那么该如何在 LeetCode 刷题呢?之前的文章[算法学习之路](https://labuladong.gitbook.io/algo/)写过一些,什么按标签刷,坚持下去云云。现在距那篇文章已经过去将近一年了,我不说那些不痛不痒的话,直接说具体的建议:
**先刷二叉树,先刷二叉树,先刷二叉树**
......@@ -214,7 +214,7 @@ void traverse(TreeNode* node) {
再举例吧,说几道我们之前文章写过的问题。
[动态规划详解](https://labuladong.gitbook.io/algo)说过凑零钱问题,暴力解法就是遍历一棵 N 叉树:
[动态规划详解](https://labuladong.gitbook.io/algo/)说过凑零钱问题,暴力解法就是遍历一棵 N 叉树:
![](../pictures/动态规划详解进阶/5.jpg)
......@@ -247,7 +247,7 @@ def dp(n):
其实很多动态规划问题就是在遍历一棵树,你如果对树的遍历操作烂熟于心,起码知道怎么把思路转化成代码,也知道如何提取别人解法的核心思路。
再看看回溯算法,前文[回溯算法详解](https://labuladong.gitbook.io/algo)干脆直接说了,回溯算法就是个 N 叉树的前后序遍历问题,没有例外。
再看看回溯算法,前文[回溯算法详解](https://labuladong.gitbook.io/algo/)干脆直接说了,回溯算法就是个 N 叉树的前后序遍历问题,没有例外。
比如 N 皇后问题吧,主要代码如下:
......@@ -286,7 +286,7 @@ N 叉树的遍历框架,找出来了把~你说,树这种结构重不重要
但是,你要是心中没有框架,那么你根本无法解题,给了你答案,你也不会发现这就是个树的遍历问题。
这种思维是很重要的,[动态规划详解](https://labuladong.gitbook.io/algo)中总结的找状态转移方程的几步流程,有时候按照流程写出解法,说实话我自己都不知道为啥是对的,反正它就是对了。。。
这种思维是很重要的,[动态规划详解](https://labuladong.gitbook.io/algo/)中总结的找状态转移方程的几步流程,有时候按照流程写出解法,说实话我自己都不知道为啥是对的,反正它就是对了。。。
**这就是框架的力量,能够保证你在快睡着的时候,依然能写出正确的程序;就算你啥都不会,都能比别人高一个级别。**
......@@ -301,7 +301,7 @@ N 叉树的遍历框架,找出来了把~你说,树这种结构重不重要
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [40张图解:TCP三次握手和四次挥手面试题](https://labuladong.gitbook.io/algo)
* [动态规划答疑篇](https://labuladong.gitbook.io/algo)
* [40张图解:TCP三次握手和四次挥手面试题](https://labuladong.gitbook.io/algo/)
* [动态规划答疑篇](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -164,7 +164,7 @@ http://graphics.stanford.edu/~seander/bithacks.html#ReverseParallel
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [二叉搜索树操作集锦](https://labuladong.gitbook.io/algo)
* [动态规划解题套路框架](https://labuladong.gitbook.io/algo)
* [二叉搜索树操作集锦](https://labuladong.gitbook.io/algo/)
* [动态规划解题套路框架](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -203,7 +203,7 @@ for (int feq : count)
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -12,8 +12,8 @@
**最新消息:关注公众号参与活动,有机会成为 [70k star 算法仓库](https://github.com/labuladong/fucking-algorithm) 的贡献者,机不可失时不再来**
相关推荐:
* [东哥吃葡萄时竟然吃出一道算法题!](https://labuladong.gitbook.io/algo)
* [如何寻找缺失的元素](https://labuladong.gitbook.io/algo)
* [东哥吃葡萄时竟然吃出一道算法题!](https://labuladong.gitbook.io/algo/)
* [如何寻找缺失的元素](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -363,7 +363,7 @@ class Solution:
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [手把手带你刷二叉树(第三期)](https://labuladong.gitbook.io/algo)
* [Union-Find算法应用](https://labuladong.gitbook.io/algo)
* [手把手带你刷二叉树(第三期)](https://labuladong.gitbook.io/algo/)
* [Union-Find算法应用](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -34,7 +34,7 @@
![](../pictures/pancakeSort/title.png)
如何解决这个问题呢?其实类似上篇文章 [递归反转链表的一部分](https://labuladong.gitbook.io/algo),这也是需要**递归思想**的。
如何解决这个问题呢?其实类似上篇文章 [递归反转链表的一部分](https://labuladong.gitbook.io/algo/),这也是需要**递归思想**的。
### 一、思路分析
......@@ -141,7 +141,7 @@ void reverse(int[] arr, int i, int j) {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [Git/SQL/正则表达式的在线练习平台](https://labuladong.gitbook.io/algo)
* [回溯算法团灭子集、排列、组合问题](https://labuladong.gitbook.io/algo)
* [Git/SQL/正则表达式的在线练习平台](https://labuladong.gitbook.io/algo/)
* [回溯算法团灭子集、排列、组合问题](https://labuladong.gitbook.io/algo/)
**-----------**
......@@ -96,7 +96,7 @@ PS:**如果有的英文题目实在看不懂,有个小技巧**,你在题
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [特殊数据结构:单调队列](https://labuladong.gitbook.io/algo)
* [设计Twitter](https://labuladong.gitbook.io/algo)
* [特殊数据结构:单调队列](https://labuladong.gitbook.io/algo/)
* [设计Twitter](https://labuladong.gitbook.io/algo/)
**-----------**
......@@ -267,7 +267,7 @@ https://leetcode.com/tag/divide-and-conquer/
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [25 张图解:键入网址后,到网页显示,其间发生了什么](https://labuladong.gitbook.io/algo)
* [如何在无限序列中随机抽取元素](https://labuladong.gitbook.io/algo)
* [25 张图解:键入网址后,到网页显示,其间发生了什么](https://labuladong.gitbook.io/algo/)
* [如何在无限序列中随机抽取元素](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -338,7 +338,7 @@ class LRUCache {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [如何运用贪心思想玩跳跃游戏](https://labuladong.gitbook.io/algo)
* [如何寻找最长回文子串](https://labuladong.gitbook.io/algo)
* [如何运用贪心思想玩跳跃游戏](https://labuladong.gitbook.io/algo/)
* [如何寻找最长回文子串](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -161,7 +161,7 @@ for (int i = 0; i < n; i++)
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [区间调度之区间交集问题](https://labuladong.gitbook.io/algo)
* [动态规划和回溯算法到底谁是谁爹?](https://labuladong.gitbook.io/algo)
* [区间调度之区间交集问题](https://labuladong.gitbook.io/algo/)
* [动态规划和回溯算法到底谁是谁爹?](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -32,7 +32,7 @@
### 一、分析问题
首先,前文[学习数据结构的框架思维](https://labuladong.gitbook.io/algo)提到过,链表是一种兼具递归和迭代性质的数据结构,认真思考一下可以发现**这个问题具有递归性质**
首先,前文[学习数据结构的框架思维](https://labuladong.gitbook.io/algo/)提到过,链表是一种兼具递归和迭代性质的数据结构,认真思考一下可以发现**这个问题具有递归性质**
什么叫递归性质?直接上图理解,比如说我们对这个链表调用 `reverseKGroup(head, 2)`,即以 2 个节点为一组反转链表:
......@@ -148,7 +148,7 @@ ListNode reverseKGroup(ListNode head, int k) {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [学习算法和数据结构的思路指南](https://labuladong.gitbook.io/algo)
* [我用四个命令概括了 Git 的所有套路](https://labuladong.gitbook.io/algo)
* [学习算法和数据结构的思路指南](https://labuladong.gitbook.io/algo/)
* [我用四个命令概括了 Git 的所有套路](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -141,7 +141,7 @@ int bulbSwitch(int n) {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [twoSum问题的核心思想](https://labuladong.gitbook.io/algo)
* [经典动态规划:子集背包问题](https://labuladong.gitbook.io/algo)
* [twoSum问题的核心思想](https://labuladong.gitbook.io/algo/)
* [经典动态规划:子集背包问题](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -20,7 +20,7 @@
**-----------**
二分查找本身不难理解,难在巧妙地运用二分查找技巧。对于一个问题,你可能都很难想到它跟二分查找有关,比如前文 [最长递增子序列](https://labuladong.gitbook.io/algo) 就借助一个纸牌游戏衍生出二分查找解法。
二分查找本身不难理解,难在巧妙地运用二分查找技巧。对于一个问题,你可能都很难想到它跟二分查找有关,比如前文 [最长递增子序列](https://labuladong.gitbook.io/algo/) 就借助一个纸牌游戏衍生出二分查找解法。
今天再讲一道巧用二分查找的算法问题:如何判定字符串 `s` 是否是字符串 `t` 的子序列(可以假定 `s` 长度比较小,且 `t` 的长度非常大)。举两个例子:
......@@ -95,7 +95,7 @@ for (int i = 0; i < n; i++) {
### 三、再谈二分查找
在前文 [二分查找详解](https://labuladong.gitbook.io/algo) 中,详解了如何正确写出三种二分查找算法的细节。二分查找返回目标值 `val` 的索引,对于搜索**左侧边界**的二分查找,有一个特殊性质:
在前文 [二分查找详解](https://labuladong.gitbook.io/algo/) 中,详解了如何正确写出三种二分查找算法的细节。二分查找返回目标值 `val` 的索引,对于搜索**左侧边界**的二分查找,有一个特殊性质:
**当 `val` 不存在时,得到的索引恰好是比 `val` 大的最小元素索引**
......@@ -160,7 +160,7 @@ boolean isSubsequence(String s, String t) {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [如何高效进行模幂运算](https://labuladong.gitbook.io/algo)
* [一文学会递归解题](https://labuladong.gitbook.io/algo)
* [如何高效进行模幂运算](https://labuladong.gitbook.io/algo/)
* [一文学会递归解题](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -229,7 +229,7 @@ p.next = reverse(q);
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [回溯算法解题套路框架](https://labuladong.gitbook.io/algo)
* [Linux shell 的实用小技巧](https://labuladong.gitbook.io/algo)
* [回溯算法解题套路框架](https://labuladong.gitbook.io/algo/)
* [Linux shell 的实用小技巧](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -104,7 +104,7 @@ char leftOf(char c) {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -110,7 +110,7 @@ def deleteDuplicates(self, head: ListNode) -> ListNode:
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -12,8 +12,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [回溯算法解题套路框架](https://labuladong.gitbook.io/algo)
* [twoSum问题的核心思想](https://labuladong.gitbook.io/algo)
* [回溯算法解题套路框架](https://labuladong.gitbook.io/algo/)
* [twoSum问题的核心思想](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -276,7 +276,7 @@ void backtrack(int[] nums, LinkedList<Integer> track) {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [一个方法团灭 LeetCode 股票买卖问题](https://labuladong.gitbook.io/algo)
* [Linux shell 的实用小技巧](https://labuladong.gitbook.io/algo)
* [一个方法团灭 LeetCode 股票买卖问题](https://labuladong.gitbook.io/algo/)
* [Linux shell 的实用小技巧](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -225,7 +225,7 @@ private int distance(int[] intv) {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [算法就像搭乐高:带你手撸 LRU 算法](https://labuladong.gitbook.io/algo)
* [区间调度之区间合并问题](https://labuladong.gitbook.io/algo)
* [算法就像搭乐高:带你手撸 LRU 算法](https://labuladong.gitbook.io/algo/)
* [区间调度之区间合并问题](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -170,7 +170,7 @@ int countPrimes(int n) {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [手把手带你刷二叉树(第三期)](https://labuladong.gitbook.io/algo)
* [45张图解:IP基础知识全家桶](https://labuladong.gitbook.io/algo)
* [手把手带你刷二叉树(第三期)](https://labuladong.gitbook.io/algo/)
* [45张图解:IP基础知识全家桶](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -203,7 +203,7 @@ if (l_max < r_max) {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -12,8 +12,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [如何运用二分查找算法](https://labuladong.gitbook.io/algo)
* [动态规划答疑篇](https://labuladong.gitbook.io/algo)
* [如何运用二分查找算法](https://labuladong.gitbook.io/algo/)
* [动态规划答疑篇](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -123,7 +123,7 @@ string longestPalindrome(string s) {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [一文看懂 session 和 cookie](https://labuladong.gitbook.io/algo)
* [算法就像搭乐高:带你手撸 LFU 算法](https://labuladong.gitbook.io/algo)
* [一文看懂 session 和 cookie](https://labuladong.gitbook.io/algo/)
* [算法就像搭乐高:带你手撸 LFU 算法](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -140,7 +140,7 @@ $$ -->
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [学习算法和数据结构的思路指南](https://labuladong.gitbook.io/algo)
* [回溯算法最佳实践:括号生成](https://labuladong.gitbook.io/algo)
* [学习算法和数据结构的思路指南](https://labuladong.gitbook.io/algo/)
* [回溯算法最佳实践:括号生成](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -125,7 +125,7 @@ public int missingNumber(int[] nums) {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
......@@ -11,8 +11,8 @@
![](../pictures/souyisou.png)
相关推荐:
* [手把手带你刷二叉树(第三期)](https://labuladong.gitbook.io/algo)
* [25 张图解:键入网址后,到网页显示,其间发生了什么](https://labuladong.gitbook.io/algo)
* [手把手带你刷二叉树(第三期)](https://labuladong.gitbook.io/algo/)
* [25 张图解:键入网址后,到网页显示,其间发生了什么](https://labuladong.gitbook.io/algo/)
读完本文,你不仅学会了算法套路,还可以顺便去 LeetCode 上拿下如下题目:
......@@ -131,7 +131,7 @@ vector<int> findErrorNums(vector<int>& nums) {
**_____________**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo) 持续更新最新文章**
**刷算法,学套路,认准 labuladong,公众号和 [在线电子书](https://labuladong.gitbook.io/algo/) 持续更新最新文章**
**本小抄即将出版,微信扫码关注公众号,后台回复「小抄」限时免费获取,回复「进群」可进刷题群一起刷题,带你搞定 LeetCode**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册