-
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
-
jozve mokhaberat数字hastesh
jozve mokhaberat digital hastesh
- 2022-02-24 17:57:41下载
- 积分:1
-
wince下的sqlite数据库,简单,小,高效。
wince下的sqlite数据库,简单,小,高效。-wince under the sqlite database, simple, small and efficient.
- 2022-03-19 12:46:16下载
- 积分:1
-
串基本操作的演示实现串的赋值,连接,求子串,计算长度等操作...
串基本操作的演示实现串的赋值,连接,求子串,计算长度等操作-Series basic operation of the demonstration achieve Series assignment, connectivity, in her series, calculating the length of such an operation
- 2023-07-25 15:00:04下载
- 积分:1
-
200 良好的编辑界面,较强的控制能力,配合全屏幕编辑控制条件...
200 良好的编辑界面,较强的控制能力,配合全屏幕编辑控制条件-200 good editing interface, a strong ability to control, with full-screen editing control conditions
- 2022-07-08 10:33:20下载
- 积分:1
-
Intel386TM SX MICROPROCESSOR
datasheet
Intel386TM SX MICROPROCESSOR
datasheet
- 2023-08-07 23:25:03下载
- 积分:1
-
网防网络维护
netdefender for network defend
- 2023-05-29 08:40:09下载
- 积分:1
-
这个程序用来模拟银行业的情况
本程序主要用于模拟某银行一天的营业状况,可用文本配置窗口、
座位数和测试分钟数-This procedure used to simulate a situation in the banking business day
- 2022-05-10 11:51:54下载
- 积分:1
-
类似Windows画图板的程序,有助于Windows程序设计新手入门。
类似Windows画图板的程序,有助于Windows程序设计新手入门。-Similar procedures for Windows drawing board, will help beginners learn Windows programming.
- 2022-03-10 13:01:18下载
- 积分:1
-
不同进程之间通过sharememory共享内存方式交换数据
不同进程之间通过sharememory共享内存方式交换数据-different processes through shared memory sharememory exchange of data
- 2023-08-04 03:40:02下载
- 积分:1