-
[输入]
图的顶点个数N,图中顶点之间的关系及起点A和终点B
[输出]
若A到B无路径,则输出“There is no path” 否则输出A到B路...
[输入]
图的顶点个数N,图中顶点之间的关系及起点A和终点B
[输出]
若A到B无路径,则输出“There is no path” 否则输出A到B路径上个顶点
[存储结构]
图采用邻接矩阵的方式存储。
[算法的基本思想]
采用广度优先搜索的方法,从顶点A开始,依次访问与A邻接的顶点VA1,VA2,...,VAK, 访问遍之后,若没有访问B,则继续访问与VA1邻接的顶点VA11,VA12,...,VA1M,再访问与VA2邻接顶点...,如此下去,直至找到B,最先到达B点的路径,一定是边数最少的路径。实现时采用队列记录被访问过的顶点。每次访问与队头顶点相邻接的顶点,然后将队头顶点从队列中删去。若队空,则说明到不存在通路。在访问顶点过程中,每次把当前顶点的序号作为与其邻接的未访问的顶点的前驱顶点记录下来,以便输出时回溯。
#include
int number //队列类型
typedef struct{
int q[20]
-[imported] map of the number of vertices N, Vertex map of the relationship between the starting point and end point A and B [output] if A to B without path then exporting "There is no path" Otherwise output A to B on the path vertices [storage structure] plan adopted adjacency matrix of storage. [Algorithm for the basic idea] BFS way from the vertex A, A visit followed with adjacent vertices VA1, VA2 ,..., VAK, visiting times, if not visit B, continue to visit with the VA1 adjacent vertices VA11, VA12 ,..., VA1M. VA2 and then
- 2022-01-25 22:50:29下载
- 积分:1
-
protel dxp 实 例 5
protel dxp 实 例 5- protel dxp 实 例 5
- 2022-04-06 21:17:53下载
- 积分:1
-
页码
页码翻页,有多个翻页效果。支持翻页前、翻页后的函数回调
Page.js
翻页效果添加多个.html(Page Number Page Turning, Multiple Page Turning Effects)
- 2020-06-22 11:40:01下载
- 积分:1
-
魏凤英老师编写的eof程序
经验正交算法,和大家一起分享魏凤英老师编写的eof程序,改程序已经过检验确实有效(EOF University Corporation for Atmospheric Research
NCAR Command Language Version 6.2.1
The use of this software is governed by a License Agreement)
- 2020-06-23 11:40:02下载
- 积分:1
-
VC++获取和设置鼠标双击的时间
VC++获取和设置鼠标双击的时间,是不是在游戏开发的时候用得上,不知道这个功能是干什么的,有兴趣的下载源码参考,代码 可在VC6中直接编译,运行效果图如截图所示。
- 2022-08-09 22:30:04下载
- 积分:1
-
对autoboot源代码的分析报告。分析了autoboot的原理、安装和代码的框架结构。...
对autoboot源代码的分析报告。分析了autoboot的原理、安装和代码的框架结构。-right Autoboot source code analysis. Autoboot analysis of the principle, the installation of the framework and code structure.
- 2023-02-28 01:00:04下载
- 积分:1
-
水土保持工程概算定额》(水利部水总{2003}67号).xls
水土保持工程概算定额》(水利部水总{2003}67号).xls-fixed budget for the Soil and Water Conservation Project "(Ministry of Water total (2003) 67). Xls
- 2022-11-19 18:00:08下载
- 积分:1
-
微信小程序-表白墙
微信小程序-表白墙(php开发的小程序)(WeChat small program - the white wall)
- 2020-11-16 13:49:41下载
- 积分:1
-
加扰器解扰器设计
加扰器解扰器设计,组合逻辑电路可以选用下述不同的逻辑类型来实现:互补CMOS结构、有比电路、差 分共源-共栅电压开关逻辑(DCVSL),传输门逻辑、互补传输晶体管逻辑(CPL)或动态电 路结构,也可以是以上不同类型结构的混合。(Scrambler/ descrambler design)
- 2018-08-29 10:52:46下载
- 积分:1
-
java anti
java的反编译程序,挺好的用的。可以学习他人的源代码-java anti-compiler, it"s quite good use. Others can learn from the source code
- 2022-01-26 04:58:59下载
- 积分:1