数据结构与算法7.doc

  1. 1、本文档共18页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
数据结构与算法7

第七次作业 一、选择题 1、设图有n个顶点和e条边,当用邻接矩阵表示该图时,则求解最短路径的Floyd算法的时间复杂度为 D 。 A. O(n) B. O(n+e) C. O(n2) D. O(n3) 2、分别以下列序列构造二叉排序数(二叉查找树),与用其他3个序列所构造的结果不同的是 C : A. (100, 80, 90, 60, 120, 110, 130) B. (100, 120, 110, 130, 80, 60, 90) C. (100, 60, 80, 90, 120, 110, 130) D. (100, 80, 60, 90, 120, 130, 110) 3、在二叉平衡树中插入一个结点造成了不平衡,设最低的不平衡点为A,并已知A的左孩子的平衡因子为0,右孩子的平衡因子为1,则应作 C 型调整使其平衡。 A. LL B. LR C. RL D. RR 二、填空题 1、具有n个顶点的有向图,如果采用邻接矩阵表示该图,则求某顶点到其他各顶点的最短路径的Dijkstra算法的时间复杂度是 O(n^2) ;如果采用邻接表表示该图,则时间复杂度为 O(e) 。 2、在用Dijkstra算法求单源最短路径的过程中,将顶点集合V划分为两个集合S和V-S,其中S中的点为最短路径 已经确定的顶点集合 ,V-S中的点为 最短路径尚未确定的顶点集合 。 3、求每一对顶点之间的最短路径,可以用两种方法,一种是分别对每个顶点采用 Dijkstra 算法,另一种方法是 Floyd 。 4、假设有向图的邻接矩阵C的传递闭包为A,则A[i][j]=1表示 当且仅当有一条路径从i到j 。 5、有向图的中心点是指 具有最小偏心度的顶点 。 6、一个无序序列可以通过构造一棵 二叉排序序 Poj1125 Floyd算法 Stockbroker Grapevine Description Stockbrokers are known to overreact to rumours. You have been contracted to develop a method of spreading disinformation amongst the stockbrokers to give your employer the tactical edge in the stock market. For maximum effect, you have to spread the rumours in the fastest possible way.? Unfortunately for you, stockbrokers only trust information coming from their Trusted sources This means you have to take into account the structure of their contacts when starting a rumour. It takes a certain amount of time for a specific stockbroker to pass the rumour on to each of his colleagues. Your task will be to write a program that tells you which stockbroker to choose as your starting point for the rumour, as well as the time it will take for the rumour to spread throughout the stockbroker community. This duration is measured as the time needed for the last person to receive the information. Input Your program will inp

文档评论(0)

zhanghc + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档