-
采用邻接矩阵表示无向图,完成图的创建、图的深度优先遍历、图的广度优先遍历操作。其中图的顶点信息是字符型,图中顶点序号按字符顺序排列。本输入样例中所用的图如下所示...
采用邻接矩阵表示无向图,完成图的创建、图的深度优先遍历、图的广度优先遍历操作。其中图的顶点信息是字符型,图中顶点序号按字符顺序排列。本输入样例中所用的图如下所示:
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
-
速易ASP.NET代码生成器 速易ASP.NET代码生成器
速易ASP.NET代码生成器 速易ASP.NET代码生成器-speed easily ASP.NET code generator speed easily ASP.NET code generator
- 2022-02-05 19:08:36下载
- 积分:1
-
创建、管理线程池的源代码,跟传统的有些不同
创建、管理线程池的源代码,跟传统的有些不同
- 2022-01-25 20:27:56下载
- 积分:1
-
经典的指针应用编程(作者是C语言的开发者Kernighan和Ritch)
经典的指针应用编程(作者是C语言的开发者Kernighan和Ritch)-classic indicators Application Programming (The writer is a C language developers Kernighan and Ritch)
- 2022-03-28 23:14:17下载
- 积分:1
-
方便在c编程时 查找一些不太常用的函数
方便在c编程时 查找一些不太常用的函数
-facilitate the search for programming at some less commonly used functions Thank you
- 2022-02-26 06:45:19下载
- 积分:1
-
fft【qindows编程】
afavdsdvzfbvzxcbzxbzxfbvfxbvfbsfft上下游kavk
- 2022-03-20 19:07:17下载
- 积分:1
-
edmi reading format and sample
edmi reading format and sample
- 2022-06-18 04:08:47下载
- 积分:1
-
利用c++编写的图形显示程序,供大家学习
利用c++编写的图形显示程序,供大家学习-Using c++ graphics programs written for them to learn from
- 2022-03-04 23:25:36下载
- 积分:1
-
u盘自动读取
U盘加密解密自动获取优盘数据,请大家下载使用
- 2022-07-20 23:29:00下载
- 积分:1
-
串口助手源码(VC++ )
一个不错的串口调试助手源码,使用VC++编写,内容详尽,可供大家编写自己的串口工具时参考。该源码使用SCOMM
- 2022-02-26 07:47:41下载
- 积分:1