-
采用邻接矩阵表示无向图,完成图的创建、图的深度优先遍历、图的广度优先遍历操作。其中图的顶点信息是字符型,图中顶点序号按字符顺序排列。本输入样例中所用的图如下所示...
采用邻接矩阵表示无向图,完成图的创建、图的深度优先遍历、图的广度优先遍历操作。其中图的顶点信息是字符型,图中顶点序号按字符顺序排列。本输入样例中所用的图如下所示:
Input Format:
第一行输入两个值,第一个是图中顶点的个数,第二个是图中边的条数
第二行输入各顶点的信息,即输入每个顶点字符
第三行开始输入每条边,每条边的形式为两个顶点的序号,中间以空格隔开,输入完一条边换行
Output format:
首先输出图的顶点信息,输出完毕换行
接着输出图的邻接矩阵,假如图中有n个顶点,则输出形式为n行n列的邻接矩阵,输出完毕换行
接下来一行输出从图的第一个顶点开始进行深度优先遍历的序列,中间以空格隔开,输出完毕换行
最后一行输出从图的第一个顶点开始进行广度优先遍历的序列,中间以空格隔开,输出完毕换行
-Using an undirected graph adjacency matrix representation to complete the map creation, graph depth-first traversal, graph breadth-first traversal operation. In which vertex information is character, the graph vertex number by characters in order. The input sample used in the diagram are as follows:
Input Format:
The first line of input two values, the first one is the number of graph vertices, the second one is the number of graph edges
Second row, enter information in each vertex, that enter each vertex character
Start typing in the third line of each side, each side in the form of two vertices
- 2022-01-26 03:32:41下载
- 积分:1
-
eyedetection code which first detects a face ,then creates an roi near the eye r...
eyedetection code which first detects a face ,then creates an roi near the eye region and detects an eye.This uses the Haar classifiers in OPEN CV
- 2022-02-15 01:13:05下载
- 积分:1
-
VC++编写的一个画图小程序运行界面非常像WINDOWS自带的程序而且可以方便的继续扩充...
VC++编写的一个画图小程序运行界面非常像WINDOWS自带的程序而且可以方便的继续扩充-prepared in a small drawing running Windows interface much like its own procedures but would also facilitate the continued expansion
- 2022-01-26 04:00:13下载
- 积分:1
-
a data acquisition card data acquisition system programming interface, the data...
一个基于pci2000数据采集卡的数据采集系统的界面编程,可实现数据动态曲线的显示-a data acquisition card data acquisition system programming interface, the data show that the dynamic curve
- 2022-12-14 11:15:03下载
- 积分:1
-
System will automatically delete the directory of debug and release, so please d...
System will automatically delete the directory of debug and release, so please do not put files on these two directory.
- 2022-03-03 07:22:16下载
- 积分:1
-
一个算术编码实现的过程,自己研究时使用,别人要是对我有什么意见欢迎E我...
一个算术编码实现的过程,自己研究时使用,别人要是对我有什么意见欢迎E我-achieve an arithmetic coding process, the use of their own research, to others if I have any advice I welcome E
- 2022-01-25 19:53:45下载
- 积分:1
-
Windows API for Visual Basic
Windows API for Visual Basic
- 2022-11-05 15:40:04下载
- 积分:1
-
xpath dom4j
XPath例子,dom4j解析XML的例子-xpath dom4j
- 2022-03-21 08:18:41下载
- 积分:1
-
好的程序大家分享
好的程序大家分享- Good procedure everybody shares
- 2022-01-31 15:38:35下载
- 积分:1
-
计算机图形学中文!
计算机图形学中文!-computer graphics Chinese!
- 2022-04-01 08:36:36下载
- 积分:1