基于单向循环链表的约瑟夫(Joseph)环设计要点分析.docVIP

基于单向循环链表的约瑟夫(Joseph)环设计要点分析.doc

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
  4. 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
  5. 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们
  6. 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
  7. 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
长春建筑学院《数据结构》课程设计(论文) 基于单向循环链表的约瑟夫(Joseph)环ased on one-way circular linked list of Joseph (Joseph) ring design 年 级: 学 号: 姓 名: 专 业: 指导老师: 二零一三年十二月 摘 要 约瑟夫问题是由古罗马著名的史学家Josephus提出的问题演变而来,所以通常称为Josephus问题。改进约瑟夫问题的描述是:编号为1,2,…,n的n个人按顺时针方向围坐一,每人有一个密码Ki(整数),留作其出圈后应报到Ki后出圈。报数方法采用顺时针报数和逆时针报数交替进行,初始密码可任意确定。求最后剩下的人的编号。这个就是约瑟夫环问题的实际场景,后来老师要求我们对要求中的每人所持有的密码以及第一次的报数上限值要用随机数产生。因此约瑟夫环问题如果采用双向循环链表则能很好的解决。循环链表的数据结构,就是将一个链表的尾元素指针指向队首元素。 p-link=head解决问题的核心步骤:先建立一个具有n个链结点,无头结点的循环链表,然后确定第一个报数人的位置,并不断地从链表中删除链结点,直到链表为空。 关键词:约瑟夫环;双向循环链表;数据结构;删除结点 Abstract Joseph problem is put forward by famous ancient Roman historian Josephus problem has evolved, so often referred to as Josephus problem. Improved Joseph a description of the problem is: Numbers for 1, 2,... , n n individuals sitting around a clockwise circle, Each with a password Ki (integer), reserved for the ones with report should Ki after ones. Count off method the number off clockwise and counterclockwise count off alternates, initial password can be arbitrary. Finally the serial number of the rest of the people. This is the actual scene of Joseph ring problem, then the teacher asked us to request each held by the password and the limit on the number off of the first time to use random number is generated. So Joseph ring problem if the bidirectional circular linked list can be a very good solution. Circular linked list data structure is a list of the tail element pointer to the first element.P - link = head the core steps to solve the problem: first, set up a chain of n nodes, the headless nodes of circular linked list, and then determine the position of the first person to count off, and constantly to delete chain node from the list, until the list is empty. Key words: Joseph ring; The bidirectional circular linked list; Data structure; Delete nodes 目 录 摘 要 I Abstract II 第1章 绪 论 - 1 - 1.1设计目的: - 1 - 1.2 设计内容 - 1 - 1.3 设计要求 - 1 - 1.4 设计思想 - 2 - 第2章

文档评论(0)

boss + 关注
实名认证
文档贡献者

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

1亿VIP精品文档

相关文档