更换图片地址

This commit is contained in:
程序员吴师兄 2019-11-14 11:00:28 +08:00
parent 18798af8b9
commit 5dee53d957
68 changed files with 144 additions and 144 deletions

View File

@ -45,4 +45,4 @@ class Solution {
}
```
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/kbvfp.gif)

View File

@ -48,7 +48,7 @@
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20181112084159.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/2elr5.gif)
@ -96,4 +96,4 @@ public:
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/96yrg.png)

View File

@ -45,12 +45,12 @@
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20190502103236.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/xuoqo.gif)
### 代码实现
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20190502103307.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/7mnmj.png)
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/q9yt7.png)

View File

@ -46,16 +46,16 @@
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20181112203355.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/varp8.gif)
### 代码实现
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20181112203645.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/9iccc.png)
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/tdqxb.png)

View File

@ -44,4 +44,4 @@ class Solution {
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/z7w57.png)

View File

@ -2,7 +2,7 @@
# 杨辉三角
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20190507201419.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/yf0dp.png)
> 本文首发于公众号五分钟学算法[图解 LeetCode](https://github.com/MisterBooo/LeetCodeAnimation) 系列文章之一
>
@ -29,7 +29,7 @@
给定一个非负整数 *numRows*生成杨辉三角的前 *numRows*
![img](https://upload.wikimedia.org/wikipedia/commons/0/0d/PascalTriangleAnimated2.gif)
![img](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/ehk16.gif)
在杨辉三角中每个数是它左上方和右上方的数的和
@ -89,7 +89,7 @@ class Solution {
给定一个非负索引 *k*其中 *k* 33返回杨辉三角的第 *k*
![img](https://upload.wikimedia.org/wikipedia/commons/0/0d/PascalTriangleAnimated2.gif)
![img](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/ehk16.gif)
在杨辉三角中每个数是它左上方和右上方的数的和
@ -140,7 +140,7 @@ class Solution {
## 一个有趣的结论
感兴趣小伙伴的可以搜索一下李永乐讲得抽奖概率相关的视频里面提及到了很多杨辉三角的神奇特点
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20190509165331.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/ggto5.gif)
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/bhn6z.png)

View File

@ -2,7 +2,7 @@
# 杨辉三角
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20190507201419.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/inihp.png)
> 本文首发于公众号五分钟学算法[图解 LeetCode](https://github.com/MisterBooo/LeetCodeAnimation) 系列文章之一
>
@ -29,7 +29,7 @@
给定一个非负整数 *numRows*生成杨辉三角的前 *numRows*
![img](https://upload.wikimedia.org/wikipedia/commons/0/0d/PascalTriangleAnimated2.gif)
![img](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/ks594.gif)
在杨辉三角中每个数是它左上方和右上方的数的和
@ -89,7 +89,7 @@ class Solution {
给定一个非负索引 *k*其中 *k* 33返回杨辉三角的第 *k*
![img](https://upload.wikimedia.org/wikipedia/commons/0/0d/PascalTriangleAnimated2.gif)
![img](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/ks594.gif)
在杨辉三角中每个数是它左上方和右上方的数的和
@ -140,7 +140,7 @@ class Solution {
## 一个有趣的结论
感兴趣小伙伴的可以搜索一下李永乐讲得抽奖概率相关的视频里面提及到了很多杨辉三角的神奇特点
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20190509165331.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/0b495.gif)
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/besbk.png)

View File

@ -290,4 +290,4 @@ class Solution {
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/w3oig.png)

View File

@ -69,7 +69,7 @@
### 图片描述
![买卖股票的最佳时机 II](https://upload-images.jianshu.io/upload_images/1940317-07904ca85dc535a9.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![买卖股票的最佳时机 II](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/nkvdj.png)
### 代码实现
@ -93,7 +93,7 @@ class Solution {
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/4s1oh.png)

View File

@ -289,7 +289,7 @@ class Solution {
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/pr1o6.png)

View File

@ -75,4 +75,4 @@ class Solution {
```
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/k5tcp.png)

View File

@ -90,4 +90,4 @@ class Solution {
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/buypf.png)

View File

@ -49,7 +49,7 @@
### 动画演示
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20190115181920.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/8720h.gif)
@ -79,10 +79,10 @@
### 动画再演示
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20190115190719.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/5uz1n.gif)
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/2hfta.png)

View File

@ -37,7 +37,7 @@
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20190502092750.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/whvl5.gif)
### 代码实现
@ -77,5 +77,5 @@ public:
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/ijlxu.png)

View File

@ -67,4 +67,4 @@ class Solution {
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/8s46l.png)

View File

@ -22,7 +22,7 @@
解释链表中有一个环其尾部连接到第二个节点
```
![](https://assets.leetcode.com/uploads/2018/12/07/circularlinkedlist.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/vweoq.png)
**示例 2**
@ -32,7 +32,7 @@
解释链表中有一个环其尾部连接到第一个节点
```
![](https://assets.leetcode.com/uploads/2018/12/07/circularlinkedlist_test2.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/kxbrz.png)
**示例 3**
@ -42,7 +42,7 @@
解释链表中没有环
```
![](https://assets.leetcode.com/uploads/2018/12/07/circularlinkedlist_test3.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/w3vsg.png)
**进阶**
@ -59,7 +59,7 @@
### 动画描述
![](https://raw.githubusercontent.com/MisterBooo/myBlogPic/master/20190627145511.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/mj4qo.gif)
### 代码实现

View File

@ -40,7 +40,7 @@
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20190502105303.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/uu82j.gif)
### 代码实现
@ -76,4 +76,4 @@ class Solution {
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/obddd.png)

View File

@ -42,7 +42,7 @@
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20181110154019.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/y7nxo.gif)
### 代码实现
@ -69,4 +69,4 @@ public class Solution {
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/8yuu3.png)

View File

@ -55,7 +55,7 @@ cache.get(4); // 返回 4
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20190502105833.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/90896.gif)
### 代码实现
@ -96,4 +96,4 @@ private:
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/inind.png)

View File

@ -59,7 +59,7 @@
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20181108162351.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/4ieg7.gif)
### 代码实现
@ -98,4 +98,4 @@ public:
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fhe4g.png)

View File

@ -55,4 +55,4 @@ public:
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/m1phx.gif)

View File

@ -37,7 +37,7 @@
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20190502110607.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/59rnm.gif)
### 代码实现
@ -68,4 +68,4 @@ public:
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/9lro6.png)

View File

@ -79,7 +79,7 @@ class Solution {
### 动画描述
![](https://raw.githubusercontent.com/MisterBooo/myBlogPic/master/20190626115001.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/bbjtv.gif)
### 代码实现
@ -129,7 +129,7 @@ class Solution {
### 动画描述
![](https://raw.githubusercontent.com/MisterBooo/myBlogPic/master/20190626150830.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/8wyb2.gif)
### 代码实现

View File

@ -68,7 +68,7 @@ public class Solution {
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/tvt94.png)

View File

@ -65,4 +65,4 @@ public:
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/xzbvx.png)

View File

@ -88,4 +88,4 @@ public:
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/se6v6.png)

View File

@ -36,7 +36,7 @@
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20181115113908.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/i2nzo.gif)
### 代码实现
@ -67,4 +67,4 @@ public:
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/afv89.gif)

View File

@ -40,7 +40,7 @@
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20181106162853.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/r04hv.gif)
### 代码实现
@ -75,4 +75,4 @@ public:
};
```
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/xbyq0.gif)

View File

@ -35,7 +35,7 @@
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20181028221055.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/mol6g.gif)
### 代码实现
@ -65,4 +65,4 @@ public:
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/wavdg.png)

View File

@ -59,4 +59,4 @@ public:
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/bjgx9.png)

View File

@ -25,7 +25,7 @@
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20181102163006.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/tuy84.gif)
### 代码实现
@ -86,4 +86,4 @@ public:
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/sbo5i.png)

View File

@ -31,7 +31,7 @@
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20181101175158.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/voxlq.gif)
### 代码实现
@ -57,4 +57,4 @@ public:
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/2z3t0.png)

View File

@ -37,25 +37,25 @@
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20181027160331.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/0ga4f.gif)
设置滑动窗口的长度为 0 位于数轴的最左端
##### 1 .滑动窗口右端 R 开始移动直到区间满足给定的条件也就是和大于 7 此时停止于第三个元素 2当前的最优长度为 4
![ 1](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/8rr0w.jpg)
![ 1](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/lo41y.jpg)
##### 2. 滑动窗口左端 L 开始移动缩小滑动窗口的大小停止于第一个元素 3此时区间和为 6使得区间和不满足给定的条件此时不大于 7
![图片 2](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/77oa4.jpg)
![图片 2](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/j7qnc.jpg)
#### 3. 滑动窗口右端 R 继续移动停止于第四个元素 4此时和位 10 但最优长度仍然为 4
![图片 3](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/8ksiz.jpg)
![图片 3](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/q8dxy.jpg)
@ -95,4 +95,4 @@ class Solution {
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/0fotr.png)

View File

@ -67,7 +67,7 @@
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20181108111124.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/xu55u.gif)
### 代码实现
@ -112,4 +112,4 @@ public:
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/gkcza.png)

View File

@ -43,7 +43,7 @@
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20181031104805.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/gjz5m.gif)
### 代码实现
@ -84,4 +84,4 @@ public:
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/msz27.png)

View File

@ -104,4 +104,4 @@ ListNode* mergeTwoOrderedLists(ListNode* pHead1, ListNode* pHead2){
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/1ubug.png)

View File

@ -37,7 +37,7 @@
首先先来分析一下 2 的次方数的二进制写法
![表格](https://user-gold-cdn.xitu.io/2019/2/21/1690d8f7ad5bc000?w=1630&h=190&f=jpeg&s=18479)
![表格](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/3wdpd.jpg)
仔细观察可以看出 2 的次方数都只有一个 1 剩下的都是 0 根据这个特点只需要每次判断最低位是否为 1 然后向右移位最后统计 1 的个数即可判断是否是 2 的次方数
@ -63,7 +63,7 @@ public:
### 图片描述
![](https://user-gold-cdn.xitu.io/2019/2/21/1690d8f7ad92ad5e?w=356&h=466&f=jpeg&s=15576)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/1w9lq.jpg)
### 代码实现
@ -80,4 +80,4 @@ public:
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/guem9.png)

View File

@ -12,7 +12,7 @@
现有一个链表 -- head = [4,5,1,9]它可以表示为:
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20190502113234.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/uv8bw.png)
@ -49,7 +49,7 @@
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20181105171450.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/1navy.gif)
### 代码实现
@ -76,4 +76,4 @@ public:
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/f5g8p.png)

View File

@ -53,7 +53,7 @@ Deque 继承自 Queue队列它的直接实现有 ArrayDeque、LinkedLis
### 动画描述
![动画描述 Made by Jun Chen](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/20whr.gif)
![动画描述 Made by Jun Chen](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/8ggd3.gif)
### 代码实现
@ -89,4 +89,4 @@ class Solution {
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/jwm9y.gif)

View File

@ -24,11 +24,11 @@
**输入**
![图一](https://user-gold-cdn.xitu.io/2019/4/9/169ff8cbaf694440?w=2360&h=614&f=jpeg&s=63179)
![图一](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/u2jnp.jpg)
**输出**
![图二](https://user-gold-cdn.xitu.io/2019/4/9/169ff8cbb372e71f?w=2518&h=572&f=jpeg&s=62543)
![图二](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/yc4ac.jpg)
### 题目解析
@ -44,7 +44,7 @@
### 动画演示
![动画演示](https://user-gold-cdn.xitu.io/2019/4/9/169ff8cbb36cb6f7?w=939&h=507&f=gif&s=6542126)
![动画演示](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/iuxmh.gif)
### 代码实现
@ -136,7 +136,7 @@ class Solution {
这里可以参考 **归并排序 **的分治思想将这 K 个链表先划分为两个 K/2 个链表处理它们的合并然后不停的往下划分直到划分成只有一个或两个链表的任务开始合并
![归并-分治](https://user-gold-cdn.xitu.io/2019/4/9/169ff8cbb2c891fe?w=953&h=531&f=gif&s=164652)
![归并-分治](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/74ush.gif)
### 代码实现
@ -186,4 +186,4 @@ class Solution {
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/jhykq.gif)

View File

@ -36,7 +36,7 @@
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20181103145019.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/6kpyu.gif)
### 代码实现
@ -76,4 +76,4 @@ public:
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/k8lty.png)

View File

@ -16,7 +16,7 @@
你的算法应该具有线性时间复杂度 你可以不使用额外空间来实现吗
![](https://raw.githubusercontent.com/MisterBooo/myBlogPic/master/20190516113448.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/i47fw.png)
## 题目解析
@ -32,7 +32,7 @@
将少了一个数的数组与 0 n 之间完整的那个数组进行异或处理因为相同的数字异或会变为了 0 那么全部数字异或后剩下的就是少了的那个数字
![](https://raw.githubusercontent.com/MisterBooo/myBlogPic/master/20190516143539.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/el8zt.png)
#### 代码实现1
@ -75,7 +75,7 @@ class Solution {
- 遍历数组计算出原始数组中数字的累积和
- 两和相减差值就是丢失的那个数字
![](https://raw.githubusercontent.com/MisterBooo/myBlogPic/master/20190516151203.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fn1ys.gif)
```java
//小吴之前担心会数据溢出不过估计这题考察的不是这个所以测试用例没写这种吧还是能 AC
@ -123,4 +123,4 @@ public class Solution {
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/bfmeg.png)

View File

@ -62,7 +62,7 @@ for (int i = 0; i < len; i++) {
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20181116115601.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/4y1ec.gif)
@ -90,4 +90,4 @@ public:
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/j3v4r.png)

View File

@ -73,7 +73,7 @@ public int numSquares(int n) {
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20190502113958.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/pf34s.gif)
### 代码实现
@ -117,4 +117,4 @@ class Solution {
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/dell9.png)

View File

@ -32,7 +32,7 @@
动画如下
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20181027160100.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/0eeix.gif)
代码如下
@ -68,7 +68,7 @@ public:
动画如下
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20181027160135.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/jodp0.gif)
代码如下
@ -101,7 +101,7 @@ public:
动画如下
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20181030085904.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/gcetr.gif)
代码如下
```
@ -134,4 +134,4 @@ public:
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/o6der.png)

View File

@ -49,7 +49,7 @@ findMedian() -> 2
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20190502114925.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/slcao.gif)
### 代码实现
@ -91,4 +91,4 @@ class MedianFinder {
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/k2ihh.gif)

View File

@ -28,7 +28,7 @@
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20181117122234.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/lchmg.gif)
### 代码实现

View File

@ -160,4 +160,4 @@ public class Solution {
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/syhz6.png)

View File

@ -55,4 +55,4 @@ class Solution {
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fzqbe.png)

View File

@ -41,7 +41,7 @@
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20181104142817.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/xh0aj.gif)
### 代码实现
@ -86,4 +86,4 @@ public:
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/ro88e.png)

View File

@ -77,13 +77,13 @@ class Solution {
将这个二进制数转换成 16 进制表示0x55555555 有没有感觉逼格更高点
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20190509194742.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/c0s9n.png)
### 图片描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20190510090919.jpeg)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/ux5pa.jpg)

View File

@ -59,4 +59,4 @@ public:
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/bksj7.png)

View File

@ -37,7 +37,7 @@
以下十种排序算法任你挑选
![](https://raw.githubusercontent.com/MisterBooo/myBlogPic/master/20190624173156)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/qya5e.png)
可以发现使用常规的诸如 冒泡选择甚至快速排序都是不满足题目要求它们的时间复杂度都是大于或者等于 O(n logn) 而题目要求算法的时间复杂度必须优于 O(n log n)
@ -50,7 +50,7 @@
题目最终需要返回的是前 k 个频率最大的元素可以想到借助堆这种数据结构对于 k 频率之后的元素不用再去处理进一步优化时间复杂度
![](https://raw.githubusercontent.com/MisterBooo/myBlogPic/master/20190624213721.jpeg)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/nloow.jpg)
具体操作为
@ -62,7 +62,7 @@
![堆中的元素就是前 k 个频率最大的元素](https://raw.githubusercontent.com/MisterBooo/myBlogPic/master/20190624231240.gif)
![堆中的元素就是前 k 个频率最大的元素](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/xged1.gif)
代码如下
@ -115,7 +115,7 @@ class Solution {
首先依旧使用哈希表统计频率统计完成后创建一个数组将频率作为数组下标对于出现频率不同的数字集合存入对应的数组下标即可
![](https://raw.githubusercontent.com/MisterBooo/myBlogPic/master/20190625100134.jpeg)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/6tge2.jpg)
代码实现如下

View File

@ -39,7 +39,7 @@
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20190502123122.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/xfx1k.gif)
### 代码实现
@ -72,4 +72,4 @@ public:
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/y7jcl.png)

View File

@ -44,7 +44,7 @@
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20181027160512.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/3kc4w.gif)
### 代码实现
@ -77,8 +77,8 @@ public:
#### 执行结果
![img](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20181029083150.png)
![img](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/xdsii.png)
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/3zqhi.png)

View File

@ -31,7 +31,7 @@
### 动画描述
![动画描述](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/o2acw.gif)
![动画描述](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/20ahe.gif)
### 代码实现

View File

@ -66,4 +66,4 @@ class Solution:
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fdvu1.png)

View File

@ -50,7 +50,7 @@ n 最大为 500可以使用时间复杂度为 O(n^2)的算法。
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20181030112917.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/0ys9o.gif)
### 代码实现
@ -96,4 +96,4 @@ private:
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/s95kv.png)

View File

@ -41,7 +41,7 @@ D = [ 0, 2]
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20181029154232.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/dgth9.gif)
### 代码实现
@ -82,4 +82,4 @@ public:
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/sx6gy.png)

View File

@ -204,4 +204,4 @@ private:
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/gxmux.png)

View File

@ -56,9 +56,9 @@
### 动画描述
![](https://raw.githubusercontent.com/MisterBooo/myBlogPic/master/20190606112155.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/iejo0.gif)
![](https://raw.githubusercontent.com/MisterBooo/myBlogPic/master/20190606112128.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/15na7.gif)
@ -86,5 +86,5 @@ public class Solution {
}
```
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/r5cpx.png)

View File

@ -67,4 +67,4 @@ public int getImportance(List<Employee> employees, int id) {
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/wvk3e.png)

View File

@ -40,7 +40,7 @@
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20190502094455.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/6g5tm.gif)
### 代码实现
@ -74,4 +74,4 @@ public:
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/r5e2r.png)

View File

@ -29,7 +29,7 @@
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20181104095701.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/t96zg.gif)
### 代码实现
@ -72,4 +72,4 @@ public:
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/5a3tl.png)

View File

@ -84,7 +84,7 @@
代码如下
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20190502124645.jpg)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/af7fm.jpg)
@ -131,4 +131,4 @@ class Solution {
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/lnwx8.png)

View File

@ -40,7 +40,7 @@
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20181103160226.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/rjjr0.gif)
### 代码实现
@ -73,4 +73,4 @@ public:
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/l2f8n.png)

View File

@ -39,7 +39,7 @@
### 动画描述
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/20190502102629.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/v17b8.gif)
### 代码实现
@ -66,4 +66,4 @@ class Solution {
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/4beoi.png)

View File

@ -49,7 +49,7 @@
#### 动画描述
![](https://raw.githubusercontent.com/MisterBooo/myBlogPic/master/20190525181152.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/ods8b.gif)
#### 代码实现
@ -78,7 +78,7 @@ class Solution {
#### 动画描述
![](https://raw.githubusercontent.com/MisterBooo/myBlogPic/master/20190525181202.gif)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/v3tkl.gif)
#### 代码实现
@ -122,7 +122,7 @@ class Solution {
#### 动画描述
![](https://raw.githubusercontent.com/MisterBooo/myBlogPic/master/20190525181211.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/0siv7.png)
#### 代码实现
@ -143,4 +143,4 @@ class Solution {
![](https://bucket-1257126549.cos.ap-guangzhou.myqcloud.com/blog/fz0rq.png)
![](https://blog-1257126549.cos.ap-guangzhou.myqcloud.com/blog/kcet5.png)