Skip to content

Commit 843fca7

Browse files
committed
Edit files.
1 parent b760cf8 commit 843fca7

File tree

4 files changed

+401
-19
lines changed

4 files changed

+401
-19
lines changed

常见算法/图 DFS BFS.ipynb renamed to 常见算法/图-深度优先搜索DFS-广度优先搜索BFS.ipynb

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,38 +30,49 @@
3030
"\n",
3131
" ## [数据结构:图的存储结构之邻接矩阵](https://blog.csdn.net/jnu_simba/article/details/8866705)\n",
3232
" \n",
33-
" 图的邻接矩阵(Adjacency Matrix)存储方式是用两个数组来表示图。一个一维的数组存储图中顶点信息,一个二维数组(称为邻接矩阵)存储图中的边或弧的信息。\n",
33+
"图的**邻接矩阵(Adjacency Matrix)**存储方式是用两个数组来表示图。一个一维的数组存储图中顶点信息,一个二维数组(称为邻接矩阵)存储图中的边或弧的信息。\n",
3434
" \n",
3535
" 设图G有n个顶点,则邻接矩阵是一个`n*n`的方阵,定义为:\n",
3636
" \n",
3737
" ![](https://raw.githubusercontent.com/hostimg/img/gh-pages/s/20190827182144.png)\n",
3838
" \n",
39-
" 无向图:\n",
39+
"### 无向图:\n",
4040
" \n",
4141
"![](https://raw.githubusercontent.com/hostimg/img/gh-pages/s/20190828160319.png)\n",
4242
" \n",
43-
" 有向图:\n",
43+
"### 有向图:\n",
4444
" \n",
4545
"![](https://raw.githubusercontent.com/hostimg/img/gh-pages/s/20190828160358.png)\n",
4646
" \n",
4747
"\n",
48-
"**网:**\n",
48+
"## 网\n",
4949
"\n",
5050
"在图的术语中,我们提到了网的概念,也就是每条边上都带有权的图叫做网。那些这些权值就需要保存下来。\n",
5151
"\n",
5252
"设图G是网图,有n个顶点,则邻接矩阵是一个`n*n`的方阵,定义为:\n",
5353
"\n",
5454
"![](https://raw.githubusercontent.com/hostimg/img/gh-pages/s/20190827182537.png)\n",
5555
"\n",
56-
"有向图网:\n",
56+
"### 有向图网:\n",
5757
"\n",
5858
"![](https://raw.githubusercontent.com/hostimg/img/gh-pages/s/20190828160533.png)\n",
5959
"\n",
6060
"## [数据结构:图的存储结构之邻接表](https://blog.csdn.net/jnu_simba/article/details/8866844)\n",
6161
"\n",
62-
"# 深度优先搜索\n",
62+
"# 深度优先搜索(Depth-First-Search,DFS)\n",
6363
"\n",
64-
"  求连通简单图G的一棵生成树的许多方法中,深度优先搜索(depth first search)是一个十分重要的算法。\n",
64+
"求连通简单图G的一棵生成树的许多方法中,深度优先搜索(depth first search)是一个十分重要的算法。\n",
65+
"\n",
66+
"- 1.首先将根节点放入stack中。\n",
67+
"- 2.从stack中取出第一个节点,并检验它是否为目标。\n",
68+
" - 如果找到目标,则结束搜寻并回传结果。\n",
69+
" - 否则将它某一个尚未检验过的直接子节点加入stack中。\n",
70+
"- 3.重复步骤2。\n",
71+
"- 4.如果不存在未检测过的直接子节点。\n",
72+
" - 将上一级节点加入stack中。\n",
73+
" - 重复步骤2。\n",
74+
"- 5.重复步骤4。\n",
75+
"- 6.若stack为空,表示整张图都检查过了——亦即图中没有欲搜寻的目标。结束搜寻并回传“找不到目标”。\n",
6576
"\n",
6677
"基本思想:\n",
6778
"\n",
@@ -94,9 +105,9 @@
94105
],
95106
"metadata": {
96107
"kernelspec": {
97-
"display_name": "tf36",
108+
"display_name": "Python 3",
98109
"language": "python",
99-
"name": "tf36"
110+
"name": "python3"
100111
},
101112
"language_info": {
102113
"codemirror_mode": {
@@ -108,7 +119,7 @@
108119
"name": "python",
109120
"nbconvert_exporter": "python",
110121
"pygments_lexer": "ipython3",
111-
"version": "3.6.8"
122+
"version": "3.7.3"
112123
}
113124
},
114125
"nbformat": 4,

常见算法/排序算法总结.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"\n",
6363
"![](https://raw.githubusercontent.com/hostimg/img/gh-pages/s/20190824130735.png)\n",
6464
"\n",
65-
"**下面是网上流传很广一张图,的这里的快排的空间复杂度应该为$O(logn)$,最坏情况是$O(n)$,而不是$O(nlogn)$**\n",
65+
"**下面是网上流传很广一张图,的这里的快排的空间复杂度应该为$O(logn)$,而不是$O(nlogn)$(递归使用的栈空间),空间复杂度最坏情况是$O(n)$**\n",
6666
"\n",
6767
"![](https://raw.githubusercontent.com/hostimg/img/gh-pages/s/20190901010247.png)"
6868
]
@@ -300,7 +300,7 @@
300300
"name": "python",
301301
"nbconvert_exporter": "python",
302302
"pygments_lexer": "ipython3",
303-
"version": "3.6.8"
303+
"version": "3.7.3"
304304
}
305305
},
306306
"nbformat": 4,

0 commit comments

Comments
 (0)