深度优先搜寻(DFS) C语言实现
来源:互联网 发布:博物馆软件 编辑:程序博客网 时间:2024/05/20 18:00
伪代码
#define Black 2#define Gray 1#define White 0#define Infinite -1#define NIL -1struct map{int d;int f;int color;int parent;} vertix[100];int time;void DSF(int a[100][100],int n){int i;for(i = 0;i<n;i++){vertix[i].color = White;vertix[i].parent = NIL;}time = 0;for(i = 0;i<n;i++)if(vertix[i] == White)DSFvisit(a,n,i);}void DSFvisit(int a[100][100],int n,int num){int i;vertix[num] = Gray;time++;vertix[num].d = time;for(i = 0;i<n;i++)if(a[num][i])if(vertix[i].color == White){vertix[i].parent = num;DSFvisit(a,n,i);}time++;vertix[num].f = time;vertix[num].color = Black;}
0 0
- 深度优先搜寻(DFS) C语言实现
- 深度优先搜索DFS-C语言实现、思路/解析-简笔
- 深度优先遍历 DFS C实现
- 如何实现深度优先遍历(DFS)
- 深度优先搜索 (DFS)
- 深度优先搜索(DFS)
- 深度优先搜索(DFS)
- DFS(深度优先搜索)
- 深度优先搜索(dfs)
- 深度优先算法(DFS)
- DFS(深度优先搜索)
- 深度优先搜索 (DFS)
- 深度优先搜索(DFS)
- 深度优先搜索(dfs)
- 深度优先搜索(dfs)
- 深度优先搜索(dfs)
- #深度优先算法(DFS)
- 深度优先搜索(DFS)
- Xcode的快捷键
- 字符串的一些知识
- 想让程序开机启动有管理员权限,使用 Windows 服务吧!
- QPainter
- POJ 1458 Common Subsequence
- 深度优先搜寻(DFS) C语言实现
- 软件模型检测简介
- using thymeleaf之七设置属性的值(th:attr/th:value/th:alt-title/th:attrappend/th:attrprepend/th:checked)
- 提交表单提示框确定取消 点取消不会刷新页面
- 第四章 4.11.1节练习
- OSG中的智能指针
- js形成心形效果
- 3uDc 25cA5cheap burberry KFR4 nKY
- 路渤成训艺截人捅玖诓炒荷制汲挠