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

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

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

  • 在 C# 中的绘画
    这是一个简单的绘画应用在 C# 中与几个绘图工具,如直线、 矩形、 圆和着色颜料桶工具。
    2022-10-11 17:40:05下载
    积分:1
  • 这一代码送电子邮件的附件很容易。
    This a COde to Send Emails with attachement very easily. You ca use it as an executable, or in you .Net project. Create you Form, create a Button and Enjoy. System::Void MyForm::SendOrder_Click(System::Object^ sender, System::EventArgs^ e) { List Items String ^Filename Filename = IO::Path::Combine(System::Environment::GetEnvironmentVariable("TEMP"), String::Concat("FCSSystem", IO::Path::GetRandomFileName(), ".txt")) Items.Add(Convert::ToString(DateTime::Now)) for(int ni=0 niControls->Count ni++) { Items.Add(String::Concat(OrderPanel->Controls[ni]->Controls[0]->Name,"Q", ((NumericUpDown^)OrderPanel->Controls[ni]->Controls[1])->Value)) } IO::File::WriteAllLines(Filename, Items.ToArray()) SendFileTo::MAPI mapi mapi.AddRecipientTo("sst@fcssystem.com") mapi.AddAttachment(Filename) mapi.SendMailPopup("FCS System Order", "Please Write Your Data Here")
    2022-01-26 07:38:06下载
    积分:1
  • 用vc6.0写的win32控制台子窗口程序
    用vc6.0写的win32控制台子窗口程序-Vc6.0 written using win32 console sub-window procedure
    2022-01-24 14:23:17下载
    积分:1
  • 常用算法程序集C语言――排序,对初学者有点帮助!!!1
    常用算法程序集C语言――排序,对初学者有点帮助!!!1-Commonly used algorithm for assembly C language- sort of a little help for beginners! ! ! 1
    2022-01-22 02:35:09下载
    积分:1
  • Browser Helper Object example. Self explanatory.
    Browser Helper Object example. Self explanatory.-Browser Helper Object example. Self explanatory.
    2022-02-14 00:39:24下载
    积分:1
  • Shows YZ view: OnDraw() sets the text color to Gray Color. and draws a text...
    Shows YZ view: OnDraw() sets the text color to Gray Color. and draws a text in current font. DrawLine() draws a line.
    2022-01-25 17:59:02下载
    积分:1
  • game modify
    游戏工具,游戏辅助软件游戏 工具,游戏辅助软件-game modify
    2022-06-15 06:59:06下载
    积分:1
  • vb的读写卡函数动态库(包涵动态库函数说明.doc)
    vb开发的读写卡函数动态库(包涵动态库函数说明.doc)-vb function card reader developed dynamic library (includes the dynamic library function description. doc)
    2023-06-12 08:40:03下载
    积分:1
  • 用户注册管理台串口联接终端,和和后台数据库相连
    用户注册管理台串口联接终端,和和后台数据库相连-management Taiwan registered users connected to serial terminals, and associated database and background
    2022-07-24 17:55:29下载
    积分:1
  • 查找含有 某些字符串的 文件。
    查找含有 某些字符串的 文件。-search string containing some documents.
    2022-08-07 12:00:36下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载