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

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

于 2022-01-28 发布 文件大小:1.53 kB
0 231
下载积分: 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 个回复

  • 不好意思,手头没有源码,但急需一些贵站的资源。请谅解。...
    不好意思,手头没有源码,但急需一些贵站的资源。请谅解。-sorry, not available source code, but some sort of Guizhan resources. Please understanding.
    2023-05-11 12:20:02下载
    积分:1
  • Based on the WinCE operating system, SMDK2410 hardware development platform unde...
    基于WinCE操作系统、SMDK2410硬件开发平台下的WIO -Based on the WinCE operating system, SMDK2410 hardware development platform under the WIO
    2023-05-20 22:00:03下载
    积分:1
  • 一个万能算法函数,能够对任意的两种数据类型
    一个万能算法函数,能够对任意的两种数据类型-A universal algorithm function, capable of two arbitrary data type
    2022-08-06 13:32:06下载
    积分:1
  • mp3 player (vc++) support synchronous lyrics display
    mp3播放器(vc++) 支持歌词同步显示-mp3 player (vc++) support synchronous lyrics display
    2023-02-13 01:15:04下载
    积分:1
  • 读者写者问题,实现模拟
    读者写者问题,实现模拟 -Readers to write the problem, realize analog
    2022-01-31 04:26:47下载
    积分:1
  • use Concentric Circle paintings
    利用Bresenham画圆法画同心圆-use Concentric Circle paintings
    2022-03-12 17:36:47下载
    积分:1
  • Android实现自动、手动更新应用
    代码简单、易懂、实用。 import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.util.HashMap; import android.app.AlertDialog; import android.app.Dialog; import android.app.AlertDialog.Builder; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.DialogInterface.OnClickListener; import android.content.pm.PackageManager.NameNotFoundException; import android.net.Uri; import android.os.Environment; import android.os.Handler; import android.os.Message; import android.view.LayoutInflater; import android.view.View; import android.widget.ProgressBar; import android.widget.Toast; /** *@author coolszy *@date 2012-4-26 *@blog http://blog.92coding.com */ public class UpdateManager { /
    2022-03-30 02:32:04下载
    积分:1
  • This my information, so the three experiments (1, l
    这是我做的信息论的3实验程序 (1、l-d编码 2、哈夫曼编码 3、维吉尼亚密码)-This my information, so the three experiments (1, l-d code 2, 3 Huffman coding, Virginia password)
    2022-03-23 09:38:18下载
    积分:1
  • 之间的转换中缀,前缀和后缀
    conversion between infix, prefix and postfix
    2022-03-10 18:21:53下载
    积分:1
  • Loads an 3d object from Gmax or 3d studio max into opengl Loads an 3d object fro...
    Loads an 3d object from Gmax or 3d studio max into opengl Loads an 3d object from Gmax or 3d studio max into opengl Loads an 3d object from Gmax or 3d studio max into opengl-Loads an 3d object from Gmax or 3d studio max into opengl Loads an 3d object from Gmax or 3d studio max into opengl Loads an 3d object from Gmax or 3d studio max into opengl Loads an 3d object from Gmax or 3d studio max into opengl
    2022-03-23 06:37:18下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载