文件名称:ysfh
- 所属分类:
- 数据结构常用算法
- 资源属性:
- [Text]
- 上传时间:
- 2012-11-26
- 文件大小:
- 1kb
- 下载次数:
- 0次
- 提 供 者:
- akon_*****
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
约瑟夫环的问题采用的是典型的循环链表的数据结构,就是将一个链表的尾元素指针指向队首元素。
解决问题的核心步骤:
1.建立一个具有n个链结点,无头结点的循环链表;
2.确定第1个报数人的位置;
3.不断地从链表中删除链结点,直到链表为空。
具体过程就是先建一个单向循环链表,用来存储这些人的编码和密码。然后删掉报数为m的人,在删除的同时将这个人的密码和标号输出。直到把这个链表删空为止。这就是我解决这个问题的方案。
-Joseph Ring is a typical problem with circular list data structure is a list of the last element pointer to force the first element. The core problem-solving steps: 1. To establish a link with n-points, without a head of circular list node 2. Identified the first one reported the location of several people 3. Continuously removed from the list link point, until the list is empty. Specific process is to first build a one-way circular linked list, these people used to store code and password. Then delete the number m of people reported in these individuals at the same time remove the password and label output. Delete this list until it is empty. This is what I solve this problem.
解决问题的核心步骤:
1.建立一个具有n个链结点,无头结点的循环链表;
2.确定第1个报数人的位置;
3.不断地从链表中删除链结点,直到链表为空。
具体过程就是先建一个单向循环链表,用来存储这些人的编码和密码。然后删掉报数为m的人,在删除的同时将这个人的密码和标号输出。直到把这个链表删空为止。这就是我解决这个问题的方案。
-Joseph Ring is a typical problem with circular list data structure is a list of the last element pointer to force the first element. The core problem-solving steps: 1. To establish a link with n-points, without a head of circular list node 2. Identified the first one reported the location of several people 3. Continuously removed from the list link point, until the list is empty. Specific process is to first build a one-way circular linked list, these people used to store code and password. Then delete the number m of people reported in these individuals at the same time remove the password and label output. Delete this list until it is empty. This is what I solve this problem.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
约瑟夫环.txt