文件名称:ysfh
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:1.16kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
约瑟夫环的问题采用的是典型的循环链表的数据结构,就是将一个链表的尾元素指针指向队首元素。
解决问题的核心步骤:
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
1999-2046 搜珍网 All Rights Reserved.
本站作为网络服务提供者,仅为网络服务对象提供信息存储空间,仅对用户上载内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。
