替换图片链接

This commit is contained in:
programmercarl
2025-03-17 15:52:23 +08:00
parent 91e7dab72c
commit 86a0208485
216 changed files with 813 additions and 813 deletions

View File

@@ -62,7 +62,7 @@
给大家举一个例子:
![](https://code-thinking-1253855093.file.myqcloud.com/pics/20240328104119.png)
![](https://file.kamacoder.com/pics/20240328104119.png)
本图中,对所有边进行松弛,真正有效的松弛,只有松弛 边节点1->节点2 和 边节点1->节点3
@@ -97,7 +97,7 @@
初始化起点为节点1 起点到起点的最短距离为0所以minDist[1] 为 0。 将节点1 加入队列 下次松弛从节点1开始
![](https://code-thinking-1253855093.file.myqcloud.com/pics/20240411115555.png)
![](https://file.kamacoder.com/pics/20240411115555.png)
------------
@@ -109,7 +109,7 @@
将节点2、节点3 加入队列,如图:
![](https://code-thinking-1253855093.file.myqcloud.com/pics/20240411115544.png)
![](https://file.kamacoder.com/pics/20240411115544.png)
-----------------
@@ -124,7 +124,7 @@
将节点4节点5 加入队列,如图:
![](https://code-thinking-1253855093.file.myqcloud.com/pics/20240412110348.png)
![](https://file.kamacoder.com/pics/20240412110348.png)
--------------------
@@ -134,7 +134,7 @@
因为没有从节点3作为出发点的边所以这里就从队列里取出节点3就好不用做其他操作如图
![](https://code-thinking-1253855093.file.myqcloud.com/pics/20240412110420.png)
![](https://file.kamacoder.com/pics/20240412110420.png)
------------
@@ -147,7 +147,7 @@
如图:
![](https://code-thinking-1253855093.file.myqcloud.com/pics/20240412110445.png)
![](https://file.kamacoder.com/pics/20240412110445.png)
---------------
@@ -160,7 +160,7 @@
如图将节点3加入队列因为节点6已经在队列里所以不用重复添加
![](https://code-thinking-1253855093.file.myqcloud.com/pics/20240729161116.png)
![](https://file.kamacoder.com/pics/20240729161116.png)
所以我们在加入队列的过程可以有一个优化,**用visited数组记录已经在队列里的元素已经在队列的元素不用重复加入**
@@ -174,7 +174,7 @@
所以直接从队列中取出,如图:
![](https://code-thinking-1253855093.file.myqcloud.com/pics/20240411115424.png)
![](https://file.kamacoder.com/pics/20240411115424.png)
----------
@@ -264,7 +264,7 @@ int main() {
至于为什么 双向图且每一个节点和所有其他节点都相连的话,每个节点 都有 n-1 条指向该节点的边, 我再来举个例子,如图:
[](https://code-thinking-1253855093.file.myqcloud.com/pics/20240416104138.png)
[](https://file.kamacoder.com/pics/20240416104138.png)
图中 每个节点都与其他所有节点相连节点数n 为 4每个节点都有3条指向该节点的边即入度为3。
@@ -329,7 +329,7 @@ SPFA队列优化版Bellman_ford 在理论上 时间复杂度更胜一筹
如图:
![](https://code-thinking-1253855093.file.myqcloud.com/pics/20240412111849.png)
![](https://file.kamacoder.com/pics/20240412111849.png)
正权回路 就是有环,但环的总权值为正数。