登录
首页 » Windows开发 » Description: 采用邻接表表示有向图,完成图的创建、图的深度优先遍历、图的广度优先遍历操作。其中图的顶点信息是字符型,图中顶点序号按字符顺序排列,...

Description: 采用邻接表表示有向图,完成图的创建、图的深度优先遍历、图的广度优先遍历操作。其中图的顶点信息是字符型,图中顶点序号按字符顺序排列,...

于 2022-01-28 发布 文件大小:1.53 kB
0 51
下载积分: 2 下载次数: 1

代码说明:

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

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 高压电流,用户名为admin密码也为Admin 里面有数据医疗队,欢迎反正。...
    高压电流,用户名为admin密码也为Admin 里面有数据医疗队,欢迎反正。-high voltage current, user name admin password for the Admin team data inside welcome anyway.
    2022-05-07 09:43:30下载
    积分:1
  • window 硬件信息的获取,包括CPU,内存,硬盘空间等等;
    window 硬件信息的获取,包括CPU,内存,硬盘空间等等;-access to information window hardware, including CPU, memory, hard disk space, etc.
    2022-08-09 15:30:48下载
    积分:1
  • 简单和经典的小程序,将有助于程序员获得更多的经验,答:..
    简单而经典的小程序,有利于编程人员获得更多的经验,更好的了解C的编程-Simple and classic small program will help programmers to get more experience, a better understanding of C programming
    2023-02-17 08:20:03下载
    积分:1
  • Realize the dynamic multi
    动态实现多视图,作者好象是印度的,从国外站点下载的代码,并且每个视图有具体的view类进行支撑,可用于多场景显示-Realize the dynamic multi-view, the author seems to be in India from the foreign site to download the code, and view each specific type of view to support, can be used for multi-scene display
    2022-05-28 23:47:02下载
    积分:1
  • CLRProfiler4内存检测
    应用背景管哪位性能测试人员,遇到这样的问题都是摸不着头脑,不知从何处下手。.net环境中不像JAVA有那么多的工具可以支撑,比如性能测试经常用到的Jconsole、Jprofiler等工具,并且基于JAVA运行环境的在打印GC日志方面也很强大。对于.net平台,微软也提供的.net辅助工具CLR Profiler可以很好的帮助我们的性能测试人员以及研发人员,找到内存没有及时回收,占着内存不释放的方法(详细到这个方法下面定义的数组或者其他变量)。关键技术 可根据自己电脑.NET的版本下载相应的CLR Profiler,我下载的是CLR Profiler for .NET Framework 4版本的。 下载后提示解压缩,选择要加压到的目录;然后进入D:SoftWareCLRProfiler4CLRProfilerBinaries目录下选择对应操作系统64位或者32位的CLRProfiler.exe。  在说一下,CLRProfiler可以分析.net平台开发的几乎所有的产品,包括C/S应用程序、服务和asp.
    2023-02-19 10:00:07下载
    积分:1
  • 如何在绘图过程中捕获鼠标(c++源码)
    如何在绘图过程中捕获鼠标(c++源码)- How catches the mouse in the cartography process (c++ source code)
    2023-03-23 16:05:04下载
    积分:1
  • 清华大学出版社
    清华大学出版社--谭浩强的的课后典型题-Qinghua University Press-- The two took strong lt; Gt C language design; Typical of the obstacles that
    2023-09-02 09:50:03下载
    积分:1
  • 给定一块宽度为W的矩形板,矩形板的高度不受限制。现需要从板上分别切割出n个高度为hi,宽度为wi的矩形零件。切割的规则是零件的高度方向与矩形板的高度方向保持一致...
    给定一块宽度为W的矩形板,矩形板的高度不受限制。现需要从板上分别切割出n个高度为hi,宽度为wi的矩形零件。切割的规则是零件的高度方向与矩形板的高度方向保持一致。问如何切割使得所使用的矩形板的高度h最小?递归分治,刚才上传的ex1.rar有错,以这个为准.-Given a width W of the rectangular plate, rectangular plate of height restrictions. Is the need to cut out from the board, respectively, n-height hi, a width of the rectangular parts wi. Parts of the rules of cutting height direction and the direction of rectangular plates with a high degree of consistency. Asked how to make the use of cutting rectangular plate of height h the smallest? Recursive sub-rule, has just uploaded ex1.rar wrong, this shall prevail.
    2022-09-10 18:50:03下载
    积分:1
  • skype api example for windows
    skype api example for windows
    2022-01-26 01:58:58下载
    积分:1
  • 3D Rubik
    3D魔方游戏源代码,下载后就在VC++平台下就可以运行-3D Rubik
    2022-08-16 12:47:57下载
    积分:1
  • 696524资源总数
  • 103945会员总数
  • 46今日下载