-
Description:
采用邻接表表示有向图,完成图的创建、图的深度优先遍历、图的广度优先遍历操作。其中图的顶点信息是字符型,图中顶点序号按字符顺序排列,...
Description:
采用邻接表表示有向图,完成图的创建、图的深度优先遍历、图的广度优先遍历操作。其中图的顶点信息是字符型,图中顶点序号按字符顺序排列,边的输入按照边的顶点序号从小到大的顺序排列,如下图的边的输入顺序为0 1,0 2,0 3,1 2,1 3,2 4,3 4共七条边,邻接表的边结点采用头插法。本输入样例中所用的图如下所示:
Input Format:
第一行输入两个值,第一个是图中顶点的个数,第二个是图中边的条数
第二行输入各顶点的信息,即输入每个顶点字符
第三行开始输入每条边,每条边的形式为两个顶点的序号,中间以空格隔开,输入完一条边换行
Output format:
首先输出图的顶点信息,输出完毕换行
接着输出图的邻接表,格式为首先输出第一个顶点,接着输出该顶点的所有的临界点的序号,换行,然后输出下一个顶点及邻接点,以此类推
接下来一行输出从图的第一个顶点开始进行深度优先遍历的序列,中间以空格隔开,输出完毕换行
最后一行输出从图的第一个顶点开始进行广度优先遍历的序列,中间以空格隔开,输出完毕换行
-Description:
Adjacency list using said directed graph to complete the map creation, map of the depth-first traversal, breadth-first graph traversal operations. In which vertex information is character, the graph vertices in order arranged by character number, while the input side of the vertex according to serial number from small to large order, the following graph of the input side of the order of 0 1,0 2,0 3,1 2,1 3,2 4,3 4 a total of seven edge, the edge-node adjacency list using the first interp
- 2022-01-28 23:09:39下载
- 积分:1
-
简单的搜索功能实现,利用vc++,可供初学者参考使用
简单的搜索功能实现,利用vc++,可供初学者参考使用-The realization of a simple search function, using vc++, Use and reference for beginners
- 2022-12-26 13:10:03下载
- 积分:1
-
可以帮助程序员清理VC工程下生成的.obj/.sbr等一系列中间垃圾文件,减少磁盘使用.ClearVCPrj.clear vc project...
可以帮助程序员清理VC工程下生成的.obj/.sbr等一系列中间垃圾文件,减少磁盘使用.ClearVCPrj.clear vc project-Clean-up can help programmers VC project generated .obj/.sbr a series of intermediate and other junk files to reduce disk usage. ClearVCPrj.clear vc project
- 2023-02-06 22:25:03下载
- 积分:1
-
Power PC 55xx flexray 通信
Power PC 55xx flexray 通信-Power PC 55xx flexray communication
- 2022-07-06 12:57:27下载
- 积分:1
-
VB猜数字游戏,游戏的源程序。适合对小游戏有兴趣的朋友玩玩。...
VB猜数字游戏,游戏的源程序。适合对小游戏有兴趣的朋友玩玩。-VB猜数字Games, Games of the source. Suitable for small game are interested in friends to play.
- 2023-05-30 18:40:03下载
- 积分:1
-
栈计算器,主要是利用栈来处理加减乘除运算
栈计算器,主要是利用栈来处理加减乘除运算-Stack calculator, mainly to deal with the use of stack Math
- 2022-11-18 04:30:03下载
- 积分:1
-
ATM机模拟,可以实现存款,取款,修改密码等功能
ATM机模拟,可以实现存款,取款,修改密码等功能-ATM machine simulation, can be achieved deposits, withdrawals, change passwords and other functions
- 2023-03-28 03:15:03下载
- 积分:1
-
可以通过网络求出对方精确的ip地址 可以方便的和对方对话
可以通过网络求出对方精确的ip地址 可以方便的和对方对话-network can be obtained through other precision ip addresses can facilitate dialogue and the other side
- 2023-08-17 19:10:03下载
- 积分:1
-
四则运算 将算术表达式转换成后缀表达式后计算
四则运算 将算术表达式转换成后缀表达式后计算-#include
#include
- 2022-02-26 10:38:04下载
- 积分:1
-
大三的经典C++程序设计问题.关于静态成员函数与友员
大三的经典C++程序设计问题.关于静态成员函数与友员-junior classic C program design. Members of the static member function and Friends
- 2022-02-01 22:14:08下载
- 积分:1