diff --git "a/problems/0042.\346\216\245\351\233\250\346\260\264.md" "b/problems/0042.\346\216\245\351\233\250\346\260\264.md"
index c208637b2f..62fbe270b7 100755
--- "a/problems/0042.\346\216\245\351\233\250\346\260\264.md"
+++ "b/problems/0042.\346\216\245\351\233\250\346\260\264.md"
@@ -14,8 +14,7 @@
示例 1:
-
-
+
* 输入:height = [0,1,0,2,1,0,1,3,2,1,2,1]
* 输出:6
* 解释:上面是由数组 [0,1,0,2,1,0,1,3,2,1,2,1] 表示的高度图,在这种情况下,可以接 6 个单位的雨水(蓝色部分表示雨水)。
diff --git "a/problems/kamacoder/0044.\345\274\200\345\217\221\345\225\206\350\264\255\344\271\260\345\234\237\345\234\260.md" "b/problems/kamacoder/0044.\345\274\200\345\217\221\345\225\206\350\264\255\344\271\260\345\234\237\345\234\260.md"
index cb5fbb7468..64804842f2 100644
--- "a/problems/kamacoder/0044.\345\274\200\345\217\221\345\225\206\350\264\255\344\271\260\345\234\237\345\234\260.md"
+++ "b/problems/kamacoder/0044.\345\274\200\345\217\221\345\225\206\350\264\255\344\271\260\345\234\237\345\234\260.md"
@@ -613,4 +613,3 @@ func main() {
}
```
-

diff --git "a/problems/kamacoder/0047.\345\217\202\344\274\232dijkstra\345\240\206.md" "b/problems/kamacoder/0047.\345\217\202\344\274\232dijkstra\345\240\206.md"
index 80d7851eaf..fceef23926 100644
--- "a/problems/kamacoder/0047.\345\217\202\344\274\232dijkstra\345\240\206.md"
+++ "b/problems/kamacoder/0047.\345\217\202\344\274\232dijkstra\345\240\206.md"
@@ -927,4 +927,3 @@ func main() {
### C
-
diff --git "a/problems/kamacoder/0047.\345\217\202\344\274\232dijkstra\346\234\264\347\264\240.md" "b/problems/kamacoder/0047.\345\217\202\344\274\232dijkstra\346\234\264\347\264\240.md"
index 42099df92a..2498643a36 100644
--- "a/problems/kamacoder/0047.\345\217\202\344\274\232dijkstra\346\234\264\347\264\240.md"
+++ "b/problems/kamacoder/0047.\345\217\202\344\274\232dijkstra\346\234\264\347\264\240.md"
@@ -942,4 +942,3 @@ main()
### C
-
diff --git "a/problems/kamacoder/0053.\345\257\273\345\256\235-Kruskal.md" "b/problems/kamacoder/0053.\345\257\273\345\256\235-Kruskal.md"
index 53da7af9ee..a7022c5d08 100644
--- "a/problems/kamacoder/0053.\345\257\273\345\256\235-Kruskal.md"
+++ "b/problems/kamacoder/0053.\345\257\273\345\256\235-Kruskal.md"
@@ -760,4 +760,3 @@ int main()
}
```
-
diff --git "a/problems/kamacoder/0053.\345\257\273\345\256\235-prim.md" "b/problems/kamacoder/0053.\345\257\273\345\256\235-prim.md"
index df0129ee2a..d3f0aeb373 100644
--- "a/problems/kamacoder/0053.\345\257\273\345\256\235-prim.md"
+++ "b/problems/kamacoder/0053.\345\257\273\345\256\235-prim.md"
@@ -757,4 +757,3 @@ main()
### C
-
diff --git "a/problems/kamacoder/0054.\346\233\277\346\215\242\346\225\260\345\255\227.md" "b/problems/kamacoder/0054.\346\233\277\346\215\242\346\225\260\345\255\227.md"
index 67d31a5564..6679f68bb6 100644
--- "a/problems/kamacoder/0054.\346\233\277\346\215\242\346\225\260\345\255\227.md"
+++ "b/problems/kamacoder/0054.\346\233\277\346\215\242\346\225\260\345\255\227.md"
@@ -432,4 +432,3 @@ echo $s;
### Rust:
-
diff --git "a/problems/kamacoder/0055.\345\217\263\346\227\213\345\255\227\347\254\246\344\270\262.md" "b/problems/kamacoder/0055.\345\217\263\346\227\213\345\255\227\347\254\246\344\270\262.md"
index be998390c5..b0918f4eea 100644
--- "a/problems/kamacoder/0055.\345\217\263\346\227\213\345\255\227\347\254\246\344\270\262.md"
+++ "b/problems/kamacoder/0055.\345\217\263\346\227\213\345\255\227\347\254\246\344\270\262.md"
@@ -409,4 +409,3 @@ echo $s;
### Rust:
-
diff --git "a/problems/kamacoder/0058.\345\214\272\351\227\264\345\222\214.md" "b/problems/kamacoder/0058.\345\214\272\351\227\264\345\222\214.md"
index 894e0383d5..b62adcfc62 100644
--- "a/problems/kamacoder/0058.\345\214\272\351\227\264\345\222\214.md"
+++ "b/problems/kamacoder/0058.\345\214\272\351\227\264\345\222\214.md"
@@ -408,4 +408,3 @@ func main() {
}
```
-
diff --git "a/problems/kamacoder/0094.\345\237\216\345\270\202\351\227\264\350\264\247\347\211\251\350\277\220\350\276\223I-SPFA.md" "b/problems/kamacoder/0094.\345\237\216\345\270\202\351\227\264\350\264\247\347\211\251\350\277\220\350\276\223I-SPFA.md"
index 9d3fbe839e..bebc2f39c5 100644
--- "a/problems/kamacoder/0094.\345\237\216\345\270\202\351\227\264\350\264\247\347\211\251\350\277\220\350\276\223I-SPFA.md"
+++ "b/problems/kamacoder/0094.\345\237\216\345\270\202\351\227\264\350\264\247\347\211\251\350\277\220\350\276\223I-SPFA.md"
@@ -536,4 +536,3 @@ main()
-
diff --git "a/problems/kamacoder/0094.\345\237\216\345\270\202\351\227\264\350\264\247\347\211\251\350\277\220\350\276\223I.md" "b/problems/kamacoder/0094.\345\237\216\345\270\202\351\227\264\350\264\247\347\211\251\350\277\220\350\276\223I.md"
index 63d1be2a30..fc79bcde1a 100644
--- "a/problems/kamacoder/0094.\345\237\216\345\270\202\351\227\264\350\264\247\347\211\251\350\277\220\350\276\223I.md"
+++ "b/problems/kamacoder/0094.\345\237\216\345\270\202\351\227\264\350\264\247\347\211\251\350\277\220\350\276\223I.md"
@@ -538,4 +538,3 @@ main()
### C
-
diff --git "a/problems/kamacoder/0095.\345\237\216\345\270\202\351\227\264\350\264\247\347\211\251\350\277\220\350\276\223II.md" "b/problems/kamacoder/0095.\345\237\216\345\270\202\351\227\264\350\264\247\347\211\251\350\277\220\350\276\223II.md"
index 957b8a80bc..f9cf8151b0 100644
--- "a/problems/kamacoder/0095.\345\237\216\345\270\202\351\227\264\350\264\247\347\211\251\350\277\220\350\276\223II.md"
+++ "b/problems/kamacoder/0095.\345\237\216\345\270\202\351\227\264\350\264\247\347\211\251\350\277\220\350\276\223II.md"
@@ -183,7 +183,6 @@ struct Edge { //邻接表
Edge(int t, int w): to(t), val(w) {} // 构造函数
};
-
int main() {
int n, m, p1, p2, val;
cin >> n >> m;
@@ -229,16 +228,111 @@ int main() {
}
}
}
-
if (flag) cout << "circle" << endl;
else if (minDist[end] == INT_MAX) {
cout << "unconnected" << endl;
} else {
cout << minDist[end] << endl;
}
-
}
+```
+
+以上代码看上去没问题,但提交之后会发现报错了,为什么呢?
+
+例如这组数据:
+
+```
+4 6
+1 4 3
+1 2 1
+1 3 1
+3 2 -2
+2 4 1
+3 4 0
+```
+
+如图:
+
+
+
+上面代码在执行的过程中,节点4 已经出队列了,但 计算入度会反复计算 节点4的入度,导致 误判 该图有环。
+
+我们需要记录哪些节点已经出队列了,哪些节点在队列里面,对于已经出队列的节点不用统计入度,以下为优化后的代码:
+
+```CPP
+#include
+#include
+#include
+#include
+#include
+using namespace std;
+
+struct Edge { //邻接表
+ int to; // 链接的节点
+ int val; // 边的权重
+
+ Edge(int t, int w): to(t), val(w) {} // 构造函数
+};
+
+
+int main() {
+ int n, m, p1, p2, val;
+ cin >> n >> m;
+
+ vector> grid(n + 1); // 邻接表
+
+ // 将所有边保存起来
+ for(int i = 0; i < m; i++){
+ cin >> p1 >> p2 >> val;
+ // p1 指向 p2,权值为 val
+ grid[p1].push_back(Edge(p2, val));
+ }
+ int start = 1; // 起点
+ int end = n; // 终点
+
+ vector minDist(n + 1 , INT_MAX);
+ minDist[start] = 0;
+
+ queue que;
+ que.push(start); // 队列里放入起点
+
+ vector count(n+1, 0); // 记录节点加入队列几次
+ count[start]++;
+ vector inQueue(n+1, false); // 记录节点是否在队列中
+
+ bool flag = false;
+ while (!que.empty()) {
+
+ int node = que.front(); que.pop();
+ inQueue[node] = false; // 节点出队
+
+ for (Edge edge : grid[node]) {
+ int from = node;
+ int to = edge.to;
+ int value = edge.val;
+ if (minDist[to] > minDist[from] + value) { // 开始松弛
+ minDist[to] = minDist[from] + value;
+ if (!inQueue[to]) { // 避免重复入队
+ que.push(to);
+ inQueue[to] = true;
+ count[to]++;
+ if (count[to] == n) {// 如果加入队列次数超过 n-1次 就说明该图与负权回路
+ flag = true;
+ while (!que.empty()) que.pop();
+ break;
+ }
+ }
+ }
+ }
+ }
+ if (flag) cout << "circle" << endl;
+ else if (minDist[end] == INT_MAX) {
+ cout << "unconnected" << endl;
+ } else {
+ cout << minDist[end] << endl;
+ }
+}
```
## 其他语言版本
@@ -456,4 +550,3 @@ if __name__ == "__main__":
### C
-
diff --git "a/problems/kamacoder/0096.\345\237\216\345\270\202\351\227\264\350\264\247\347\211\251\350\277\220\350\276\223III.md" "b/problems/kamacoder/0096.\345\237\216\345\270\202\351\227\264\350\264\247\347\211\251\350\277\220\350\276\223III.md"
index 0c00ccb668..7d85435eff 100644
--- "a/problems/kamacoder/0096.\345\237\216\345\270\202\351\227\264\350\264\247\347\211\251\350\277\220\350\276\223III.md"
+++ "b/problems/kamacoder/0096.\345\237\216\345\270\202\351\227\264\350\264\247\347\211\251\350\277\220\350\276\223III.md"
@@ -922,4 +922,3 @@ if __name__ == "__main__":
### C
-
diff --git "a/problems/kamacoder/0097.\345\260\217\346\230\216\351\200\233\345\205\254\345\233\255.md" "b/problems/kamacoder/0097.\345\260\217\346\230\216\351\200\233\345\205\254\345\233\255.md"
index 53e66ee46f..a2b673b373 100644
--- "a/problems/kamacoder/0097.\345\260\217\346\230\216\351\200\233\345\205\254\345\233\255.md"
+++ "b/problems/kamacoder/0097.\345\260\217\346\230\216\351\200\233\345\205\254\345\233\255.md"
@@ -574,4 +574,3 @@ if __name__ == '__main__':
### C
-
diff --git "a/problems/kamacoder/0098.\346\211\200\346\234\211\345\217\257\350\276\276\350\267\257\345\276\204.md" "b/problems/kamacoder/0098.\346\211\200\346\234\211\345\217\257\350\276\276\350\267\257\345\276\204.md"
index c71981996b..8853f78f40 100644
--- "a/problems/kamacoder/0098.\346\211\200\346\234\211\345\217\257\350\276\276\350\267\257\345\276\204.md"
+++ "b/problems/kamacoder/0098.\346\211\200\346\234\211\345\217\257\350\276\276\350\267\257\345\276\204.md"
@@ -72,6 +72,7 @@
* 1 <= N <= 100
* 1 <= M <= 500
+**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[所有可达路径](https://www.bilibili.com/video/BV1VePeepEpP),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
## 插曲
@@ -887,4 +888,3 @@ async function dfs(graph, x, n) {
-
diff --git "a/problems/kamacoder/0099.\345\262\233\345\261\277\347\232\204\346\225\260\351\207\217\345\271\277\346\220\234.md" "b/problems/kamacoder/0099.\345\262\233\345\261\277\347\232\204\346\225\260\351\207\217\345\271\277\346\220\234.md"
index 93c1fe41fa..cfa6af18e4 100644
--- "a/problems/kamacoder/0099.\345\262\233\345\261\277\347\232\204\346\225\260\351\207\217\345\271\277\346\220\234.md"
+++ "b/problems/kamacoder/0099.\345\262\233\345\261\277\347\232\204\346\225\260\351\207\217\345\271\277\346\220\234.md"
@@ -46,6 +46,8 @@
## 思路
+**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[图论:广搜有陷阱啊!! | 广度优先搜索 | 卡码网:99.岛屿数量](https://www.bilibili.com/video/BV18PRGYcEiB/),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
+
注意题目中每座岛屿只能由**水平方向和/或竖直方向上**相邻的陆地连接形成。
也就是说斜角度链接是不算了, 例如示例二,是三个岛屿,如图:
@@ -557,4 +559,3 @@ object Solution {
### C
-
diff --git "a/problems/kamacoder/0099.\345\262\233\345\261\277\347\232\204\346\225\260\351\207\217\346\267\261\346\220\234.md" "b/problems/kamacoder/0099.\345\262\233\345\261\277\347\232\204\346\225\260\351\207\217\346\267\261\346\220\234.md"
index 3c54278af0..fb824aeff2 100644
--- "a/problems/kamacoder/0099.\345\262\233\345\261\277\347\232\204\346\225\260\351\207\217\346\267\261\346\220\234.md"
+++ "b/problems/kamacoder/0099.\345\262\233\345\261\277\347\232\204\346\225\260\351\207\217\346\267\261\346\220\234.md"
@@ -46,6 +46,8 @@
## 思路
+**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[图论:来用深搜解决一道题目,两种深搜写法,你掉坑了吗? | 卡码网:99.岛屿数量](https://www.bilibili.com/video/BV18PRGYcEiB/),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
+
注意题目中每座岛屿只能由**水平方向和/或竖直方向上**相邻的陆地连接形成。
也就是说斜角度链接是不算了, 例如示例二,是三个岛屿,如图:
@@ -459,4 +461,3 @@ object Solution {
### C
-
diff --git "a/problems/kamacoder/0100.\345\262\233\345\261\277\347\232\204\346\234\200\345\244\247\351\235\242\347\247\257.md" "b/problems/kamacoder/0100.\345\262\233\345\261\277\347\232\204\346\234\200\345\244\247\351\235\242\347\247\257.md"
index 2ae1f452e0..fc024f6120 100644
--- "a/problems/kamacoder/0100.\345\262\233\345\261\277\347\232\204\346\234\200\345\244\247\351\235\242\347\247\257.md"
+++ "b/problems/kamacoder/0100.\345\262\233\345\261\277\347\232\204\346\234\200\345\244\247\351\235\242\347\247\257.md"
@@ -44,6 +44,8 @@
## 思路
+**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[图论:深搜也有陷阱啊!! | 深搜优先搜索 | 卡码网:100.岛屿的最大面积](https://www.bilibili.com/video/BV1FzoyY5EXH),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
+
注意题目中每座岛屿只能由**水平方向和/或竖直方向上**相邻的陆地连接形成。
也就是说斜角度链接是不算了, 例如示例二,是三个岛屿,如图:
@@ -890,4 +892,3 @@ main();
### C
-
diff --git "a/problems/kamacoder/0101.\345\255\244\345\262\233\347\232\204\346\200\273\351\235\242\347\247\257.md" "b/problems/kamacoder/0101.\345\255\244\345\262\233\347\232\204\346\200\273\351\235\242\347\247\257.md"
index c883100724..b3f66b96d8 100644
--- "a/problems/kamacoder/0101.\345\255\244\345\262\233\347\232\204\346\200\273\351\235\242\347\247\257.md"
+++ "b/problems/kamacoder/0101.\345\255\244\345\262\233\347\232\204\346\200\273\351\235\242\347\247\257.md"
@@ -48,6 +48,8 @@
## 思路
+**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[图论:岛屿问题再出新花样 | 深搜优先搜索 | 卡码网:101.孤岛总面积](https://www.bilibili.com/video/BV1mmZJYRESc),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
+
本题使用dfs,bfs,并查集都是可以的。
本题要求找到不靠边的陆地面积,那么我们只要从周边找到陆地然后 通过 dfs或者bfs 将周边靠陆地且相邻的陆地都变成海洋,然后再去重新遍历地图 统计此时还剩下的陆地就可以了。
@@ -700,4 +702,3 @@ const bfs = (graph, x, y) => {
### C
-
diff --git "a/problems/kamacoder/0102.\346\262\211\346\262\241\345\255\244\345\262\233.md" "b/problems/kamacoder/0102.\346\262\211\346\262\241\345\255\244\345\262\233.md"
index 1b31676277..e335a018f5 100644
--- "a/problems/kamacoder/0102.\346\262\211\346\262\241\345\255\244\345\262\233.md"
+++ "b/problems/kamacoder/0102.\346\262\211\346\262\241\345\255\244\345\262\233.md"
@@ -55,6 +55,8 @@
## 思路
+**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[图论:岛屿问题也需要逆向思考 | 深搜优先搜索DFS | 卡码网:102.沉没孤岛](https://www.bilibili.com/video/BV1fjdWYyEGu),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
+
这道题目和[0101.孤岛的总面积](https://kamacoder.com/problempage.php?pid=1173)正好反过来了,[0101.孤岛的总面积](https://kamacoder.com/problempage.php?pid=1173)是求 地图中间的空格数,而本题是要把地图中间的 1 都改成 0 。
那么两题在思路上也是差不多的。
@@ -503,4 +505,3 @@ const bfs = (graph, x, y) => {
### C
-
diff --git "a/problems/kamacoder/0103.\346\260\264\346\265\201\351\227\256\351\242\230.md" "b/problems/kamacoder/0103.\346\260\264\346\265\201\351\227\256\351\242\230.md"
index bf6cd40f43..9ae8f745fb 100644
--- "a/problems/kamacoder/0103.\346\260\264\346\265\201\351\227\256\351\242\230.md"
+++ "b/problems/kamacoder/0103.\346\260\264\346\265\201\351\227\256\351\242\230.md"
@@ -59,6 +59,8 @@
## 思路
+**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[图论:水流向何方? | 深搜优先搜索DFS| 广度优先搜索BFS | 卡码网:103.水流问题](https://www.bilibili.com/video/BV1WNoEYrEio),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
+
一个比较直白的想法,其实就是 遍历每个点,然后看这个点 能不能同时到达第一组边界和第二组边界。
至于遍历方式,可以用dfs,也可以用bfs,以下用dfs来举例。
@@ -854,4 +856,3 @@ const isResult = (x, y) => {
-
diff --git "a/problems/kamacoder/0104.\345\273\272\351\200\240\346\234\200\345\244\247\345\262\233\345\261\277.md" "b/problems/kamacoder/0104.\345\273\272\351\200\240\346\234\200\345\244\247\345\262\233\345\261\277.md"
index 8c4964a9e4..619c5bccb8 100644
--- "a/problems/kamacoder/0104.\345\273\272\351\200\240\346\234\200\345\244\247\345\262\233\345\261\277.md"
+++ "b/problems/kamacoder/0104.\345\273\272\351\200\240\346\234\200\345\244\247\345\262\233\345\261\277.md"
@@ -50,6 +50,8 @@
## 思路
+**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[图论:岛屿问题上难度了! |深搜优先搜索DFS | 广度优先搜索BFS | 卡码网:104.建造最大岛屿](https://www.bilibili.com/video/BV1Dn5CzZEw1/),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
+
本题的一个暴力想法,应该是遍历地图尝试 将每一个 0 改成1,然后去搜索地图中的最大的岛屿面积。
计算地图的最大面积:遍历地图 + 深搜岛屿,时间复杂度为 n * n。
@@ -663,4 +665,3 @@ const dfs = (graph, visited, x, y, mark) => {
### C
-
diff --git "a/problems/kamacoder/0105.\346\234\211\345\220\221\345\233\276\347\232\204\345\256\214\345\205\250\345\217\257\350\276\276\346\200\247.md" "b/problems/kamacoder/0105.\346\234\211\345\220\221\345\233\276\347\232\204\345\256\214\345\205\250\345\217\257\350\276\276\346\200\247.md"
index 1358f673d5..014050fd40 100644
--- "a/problems/kamacoder/0105.\346\234\211\345\220\221\345\233\276\347\232\204\345\256\214\345\205\250\345\217\257\350\276\276\346\200\247.md"
+++ "b/problems/kamacoder/0105.\346\234\211\345\220\221\345\233\276\347\232\204\345\256\214\345\205\250\345\217\257\350\276\276\346\200\247.md"
@@ -1,7 +1,7 @@
参与本项目,贡献其他语言版本的代码,拥抱开源,让更多学习算法的小伙伴们受益!
-# 105.有向图的完全可达性
+# 105.有向图的完全联通
[卡码网题目链接(ACM模式)](https://kamacoder.com/problempage.php?pid=1177)
@@ -44,6 +44,8 @@
## 思路
+**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[图论:这次我们能到达有向图的所有节点吗?| 深度优先搜索 | 卡码网:105. 有向图的完全联通](https://www.bilibili.com/video/BV1QRJ6ziEvJ),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
+
本题给我们是一个有向图, 意识到这是有向图很重要!
接下来我们再画一个图,从图里可以直观看出来,节点6 是 不能到达节点1 的
@@ -553,4 +555,3 @@ rl.on('close',()=>{
### C
-
diff --git "a/problems/kamacoder/0106.\345\262\233\345\261\277\347\232\204\345\221\250\351\225\277.md" "b/problems/kamacoder/0106.\345\262\233\345\261\277\347\232\204\345\221\250\351\225\277.md"
index 4492d5cd6d..3708715a4b 100644
--- "a/problems/kamacoder/0106.\345\262\233\345\261\277\347\232\204\345\221\250\351\225\277.md"
+++ "b/problems/kamacoder/0106.\345\262\233\345\261\277\347\232\204\345\221\250\351\225\277.md"
@@ -47,6 +47,8 @@
## 思路
+**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[图论:这次的岛屿问题有点简单了。。 卡码网:106.岛屿的周长](https://www.bilibili.com/video/BV13fjczSEyV),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
+
岛屿问题最容易让人想到BFS或者DFS,但本题确实还用不上。
为了避免大家惯性思维,所以给大家安排了这道题目。
@@ -359,4 +361,3 @@ func parseLine(line string, count int) []int {
### C
-
diff --git "a/problems/kamacoder/0107.\345\257\273\346\211\276\345\255\230\345\234\250\347\232\204\350\267\257\345\276\204.md" "b/problems/kamacoder/0107.\345\257\273\346\211\276\345\255\230\345\234\250\347\232\204\350\267\257\345\276\204.md"
index 9ab3388f17..572d4712e6 100644
--- "a/problems/kamacoder/0107.\345\257\273\346\211\276\345\255\230\345\234\250\347\232\204\350\267\257\345\276\204.md"
+++ "b/problems/kamacoder/0107.\345\257\273\346\211\276\345\255\230\345\234\250\347\232\204\350\267\257\345\276\204.md"
@@ -422,4 +422,3 @@ const isSame = (u, v) => {
### C
-
diff --git "a/problems/kamacoder/0108.\345\206\227\344\275\231\350\277\236\346\216\245.md" "b/problems/kamacoder/0108.\345\206\227\344\275\231\350\277\236\346\216\245.md"
index de2435073c..a5076468df 100644
--- "a/problems/kamacoder/0108.\345\206\227\344\275\231\350\277\236\346\216\245.md"
+++ "b/problems/kamacoder/0108.\345\206\227\344\275\231\350\277\236\346\216\245.md"
@@ -376,4 +376,3 @@ const isSame = (u, v) => {
### C
-
diff --git "a/problems/kamacoder/0109.\345\206\227\344\275\231\350\277\236\346\216\245II.md" "b/problems/kamacoder/0109.\345\206\227\344\275\231\350\277\236\346\216\245II.md"
index 6ad59c4188..fb8edbee77 100644
--- "a/problems/kamacoder/0109.\345\206\227\344\275\231\350\277\236\346\216\245II.md"
+++ "b/problems/kamacoder/0109.\345\206\227\344\275\231\350\277\236\346\216\245II.md"
@@ -596,4 +596,3 @@ const getRemoveEdge = (edges) => {
### C
-
diff --git "a/problems/kamacoder/0110.\345\255\227\347\254\246\344\270\262\346\216\245\351\276\231.md" "b/problems/kamacoder/0110.\345\255\227\347\254\246\344\270\262\346\216\245\351\276\231.md"
index 6cb5886d20..facb5f21d8 100644
--- "a/problems/kamacoder/0110.\345\255\227\347\254\246\344\270\262\346\216\245\351\276\231.md"
+++ "b/problems/kamacoder/0110.\345\255\227\347\254\246\344\270\262\346\216\245\351\276\231.md"
@@ -63,6 +63,8 @@ yhn
## 思路
+**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[图论:朴实无华的广搜这么难? | 广度优先搜索 | 卡码网:110.字符串接龙](https://www.bilibili.com/video/BV1QEEizDEC4),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
+
以示例1为例,从这个图中可以看出 abc 到 def的路线 不止一条,但最短的一条路径上是4个节点。

@@ -360,4 +362,3 @@ const init = async () => {
### C
-
diff --git "a/problems/kamacoder/0117.\350\275\257\344\273\266\346\236\204\345\273\272.md" "b/problems/kamacoder/0117.\350\275\257\344\273\266\346\236\204\345\273\272.md"
index c5650d9708..d92eede505 100644
--- "a/problems/kamacoder/0117.\350\275\257\344\273\266\346\236\204\345\273\272.md"
+++ "b/problems/kamacoder/0117.\350\275\257\344\273\266\346\236\204\345\273\272.md"
@@ -539,4 +539,3 @@ const init = async () => {
### C
-
diff --git "a/problems/kamacoder/0126.\351\252\221\345\243\253\347\232\204\346\224\273\345\207\273astar.md" "b/problems/kamacoder/0126.\351\252\221\345\243\253\347\232\204\346\224\273\345\207\273astar.md"
index 6669ce7ba1..8fd331e3cd 100644
--- "a/problems/kamacoder/0126.\351\252\221\345\243\253\347\232\204\346\224\273\345\207\273astar.md"
+++ "b/problems/kamacoder/0126.\351\252\221\345\243\253\347\232\204\346\224\273\345\207\273astar.md"
@@ -684,4 +684,3 @@ int main() {
-
diff --git "a/problems/kamacoder/\345\233\276\350\256\272\344\270\272\344\273\200\344\271\210\347\224\250ACM\346\250\241\345\274\217.md" "b/problems/kamacoder/\345\233\276\350\256\272\344\270\272\344\273\200\344\271\210\347\224\250ACM\346\250\241\345\274\217.md"
index c5122b1760..362ea9714a 100644
--- "a/problems/kamacoder/\345\233\276\350\256\272\344\270\272\344\273\200\344\271\210\347\224\250ACM\346\250\241\345\274\217.md"
+++ "b/problems/kamacoder/\345\233\276\350\256\272\344\270\272\344\273\200\344\271\210\347\224\250ACM\346\250\241\345\274\217.md"
@@ -91,4 +91,3 @@ cout << result[result.size() - 1];
等大家将图论刷完,就会感受到我的良苦用心。加油
-
diff --git "a/problems/kamacoder/\345\233\276\350\256\272\345\271\266\346\237\245\351\233\206\347\220\206\350\256\272\345\237\272\347\241\200.md" "b/problems/kamacoder/\345\233\276\350\256\272\345\271\266\346\237\245\351\233\206\347\220\206\350\256\272\345\237\272\347\241\200.md"
index 61d49b5297..9566a7b7ec 100644
--- "a/problems/kamacoder/\345\233\276\350\256\272\345\271\266\346\237\245\351\233\206\347\220\206\350\256\272\345\237\272\347\241\200.md"
+++ "b/problems/kamacoder/\345\233\276\350\256\272\345\271\266\346\237\245\351\233\206\347\220\206\350\256\272\345\237\272\347\241\200.md"
@@ -454,4 +454,3 @@ void join(int u, int v) {
敬请期待 并查集题目精讲系列。
-
diff --git "a/problems/kamacoder/\345\233\276\350\256\272\345\271\277\346\220\234\347\220\206\350\256\272\345\237\272\347\241\200.md" "b/problems/kamacoder/\345\233\276\350\256\272\345\271\277\346\220\234\347\220\206\350\256\272\345\237\272\347\241\200.md"
index 718f5484a1..c76917b742 100644
--- "a/problems/kamacoder/\345\233\276\350\256\272\345\271\277\346\220\234\347\220\206\350\256\272\345\237\272\347\241\200.md"
+++ "b/problems/kamacoder/\345\233\276\350\256\272\345\271\277\346\220\234\347\220\206\350\256\272\345\237\272\347\241\200.md"
@@ -1,5 +1,7 @@
# 广度优先搜索理论基础
+**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[广度优先搜索理论基础](https://www.bilibili.com/video/BV1M19iY4EL9),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
+
在[深度优先搜索](./图论深搜理论基础.md)的讲解中,我们就讲过深度优先搜索和广度优先搜索的区别。
广搜(bfs)是一圈一圈的搜索过程,和深搜(dfs)是一条路跑到黑然后再回溯。
@@ -102,4 +104,3 @@ void bfs(vector>& grid, vector>& visited, int x, int y
相信看完本篇,大家会对广搜有一个基础性的认识,后面再来做对应的题目就会得心应手一些。
-
diff --git "a/problems/kamacoder/\345\233\276\350\256\272\346\200\273\347\273\223\347\257\207.md" "b/problems/kamacoder/\345\233\276\350\256\272\346\200\273\347\273\223\347\257\207.md"
index d7b8da94cb..d89d6411e9 100644
--- "a/problems/kamacoder/\345\233\276\350\256\272\346\200\273\347\273\223\347\257\207.md"
+++ "b/problems/kamacoder/\345\233\276\350\256\272\346\200\273\347\273\223\347\257\207.md"
@@ -143,4 +143,3 @@ kruscal的主要思路:
图论也是我 《代码随想录》所有章节里 所费精力最大的一个章节。
只为了不负录友们的期待。 大家加油💪🏻
-
diff --git "a/problems/kamacoder/\345\233\276\350\256\272\346\267\261\346\220\234\347\220\206\350\256\272\345\237\272\347\241\200.md" "b/problems/kamacoder/\345\233\276\350\256\272\346\267\261\346\220\234\347\220\206\350\256\272\345\237\272\347\241\200.md"
index 50df8aa6df..29256de466 100644
--- "a/problems/kamacoder/\345\233\276\350\256\272\346\267\261\346\220\234\347\220\206\350\256\272\345\237\272\347\241\200.md"
+++ "b/problems/kamacoder/\345\233\276\350\256\272\346\267\261\346\220\234\347\220\206\350\256\272\345\237\272\347\241\200.md"
@@ -1,6 +1,8 @@
# 深度优先搜索理论基础
+**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[深度优先搜索理论基础](https://www.bilibili.com/video/BV1hFA8eKE6C),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
+
录友们期待图论内容已久了,为什么鸽了这么久,主要是最近半年开始更新[代码随想录算法公开课](https://www.bilibili.com/video/BV1fA4y1o715/),是开源在B站的算法视频,已经帮助非常多基础不好的录友学习算法。
录视频其实是非常累的,也要花很多时间,所以图论这边就没抽出时间来。
@@ -194,4 +196,3 @@ for (选择:本节点所连接的其他节点) {
后面我也会给大家安排具体练习的题目,依旧是代码随想录的风格,循序渐进由浅入深!
-
diff --git "a/problems/kamacoder/\345\233\276\350\256\272\347\220\206\350\256\272\345\237\272\347\241\200.md" "b/problems/kamacoder/\345\233\276\350\256\272\347\220\206\350\256\272\345\237\272\347\241\200.md"
index fb52c83921..13c59374fa 100644
--- "a/problems/kamacoder/\345\233\276\350\256\272\347\220\206\350\256\272\345\237\272\347\241\200.md"
+++ "b/problems/kamacoder/\345\233\276\350\256\272\347\220\206\350\256\272\345\237\272\347\241\200.md"
@@ -1,6 +1,8 @@
# 图论理论基础
+**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[图论理论基础](https://www.bilibili.com/video/BV1hYNBeYEvb/),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
+
这一篇我们正式开始图论!
代码随想录图论中的算法题目将统一使用ACM模式,[为什么要使用ACM模式](./图论为什么用ACM模式.md)
@@ -246,4 +248,3 @@ dfs 和 bfs 一种搜索算法,可以在不同的数据结构上进行搜索
敬请期待!
-
diff --git "a/problems/kamacoder/\346\234\200\347\237\255\350\267\257\351\227\256\351\242\230\346\200\273\347\273\223\347\257\207.md" "b/problems/kamacoder/\346\234\200\347\237\255\350\267\257\351\227\256\351\242\230\346\200\273\347\273\223\347\257\207.md"
index 194f1f5ee2..041d41b1ac 100644
--- "a/problems/kamacoder/\346\234\200\347\237\255\350\267\257\351\227\256\351\242\230\346\200\273\347\273\223\347\257\207.md"
+++ "b/problems/kamacoder/\346\234\200\347\237\255\350\267\257\351\227\256\351\242\230\346\200\273\347\273\223\347\257\207.md"
@@ -51,4 +51,3 @@
-
diff --git a/problems/qita/shejimoshi.md b/problems/qita/shejimoshi.md
deleted file mode 100644
index 959a3fa90a..0000000000
--- a/problems/qita/shejimoshi.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-# 23种设计模式精讲 | 配套练习题 | 卡码网
-
-关于设计模式的学习,大家应该还是看书或者看博客,但却没有一个边学边练的学习环境。
-
-学完了一种设计模式 是不是应该去练一练?
-
-所以卡码网 针对 23种设计,**推出了 23道编程题目,来帮助大家练习设计模式**。
-
-
-
-这里的23到编程题目对应了 23种这几模式。 例如第一题,小明的购物车,就是单例模式:
-
-
-
-区别于网上其他教程,本教程的特点是:
-
-* **23种设计模式全覆盖**,涵盖了所有Gang of Four设计模式,包括创建型、结构型和行为型设计模式。
-* 通过23道简单而实用的例子,**以刷算法题的形式了解每种设计模式的概念、结构和应用场景**。
-* **为每个设计模式提供清晰的文字解释、结构图和代码演示**,帮助你更好地理解和实践。
-* **难度安排循序渐进**,从基础的、常用的设计模式逐步深入。
-
-这样的一个学习体验,要收费吗?
-
-**免费的**!
-
-相信录友们可能还没有这种学习设计模式的体验,快去卡码网(kamacoder.com)上体验吧。
-
-23道 设计模式的题目给大家出了,那么是不是得安排上对应的讲解?
-
-**当然安排**!
-
-针对每道题目,还给大家编写了一套 23种设计模式精讲,已经开源到Github上:
-
-> https://github.com/youngyangyang04/kama-DesignPattern
-
-支持Java,Python,Go,C++ 版本,也欢迎大家去Github上提交PR,补充其他语言版本。
-
-所以题解也免费开放给录友!
-
-同时还给全部整理到PDF上,这份PDF,我们写的很用心了,来个大家截个图:
-
-
-
-
-
-
-
-
-
-关于设计模式的题目,大家现在就可以去 卡码网(kamacoder)去做了。
-
-关于这23道题目对应 设计模式精讲 PDF,也免费分享给录友们,大家可以加我的企业微信获取:
-
-
-已经有我企业微信的录友,直接发:设计模式,这四个字就好,我会直接发你。
-
diff --git "a/problems/\345\212\250\346\200\201\350\247\204\345\210\222\346\200\273\347\273\223\347\257\207.md" "b/problems/\345\212\250\346\200\201\350\247\204\345\210\222\346\200\273\347\273\223\347\257\207.md"
index 32df8af41c..83d88cf448 100755
--- "a/problems/\345\212\250\346\200\201\350\247\204\345\210\222\346\200\273\347\273\223\347\257\207.md"
+++ "b/problems/\345\212\250\346\200\201\350\247\204\345\210\222\346\200\273\347\273\223\347\257\207.md"
@@ -115,7 +115,7 @@
能把本篇中列举的题目都研究通透的话,你的动规水平就已经非常高了。 对付面试已经足够!
-
+
这个图是 [代码随想录知识星球](https://programmercarl.com/other/kstar.html) 成员:[青](https://wx.zsxq.com/dweb2/index/footprint/185251215558842),所画,总结的非常好,分享给大家。