文件名称:yuecefuhuan
介绍说明--下载内容均来自于网络,请自行研究使用
实验题目 约瑟夫环
一、 实验目的
用一个循环链表来实现约瑟夫环问题
二、 实验内容
编号为1,2,……,n的n个人按顺序时针方向围坐一圈,每个人吃一个密码。一开始任选一个整数作为报数上限值m,从第一个人开始顺时针自1开始顺序报数,报到m时停止报数。报m的人出列,将他的密码作为新的m值,从它在顺时针方向上的下一个人开始重新从1报数,如此下去直到所有人全部出列。
三、 需求分析
输入m=20;n=7,7个人的密码依次是:3,1,7,2,4,8,4,出列顺序为:6,1,4,7,2,3,5。
-experiment a subject Josephus, the experiment used a cycle chain to achieve Joseph Central 2. Experiment No. 1, 2, ..., n, n personal sequential anti-clockwise direction sitting around a circle and each person eating a password. An optional began as a whole reported a few limits on m, started from the first clockwise from the beginning of a sequence of several reported, m report reportedly stopped a few. M reported from the series of his password as a new value m, from it in a clockwise direction for the next re-started from a few reported that more until the total of all out. 3, needs analysis input m = 20; N = 7,7 personal password in order, are : 3,1,7,2,4,8. 4 out out in chronological order : 6,1,4,7,2,3,5.
一、 实验目的
用一个循环链表来实现约瑟夫环问题
二、 实验内容
编号为1,2,……,n的n个人按顺序时针方向围坐一圈,每个人吃一个密码。一开始任选一个整数作为报数上限值m,从第一个人开始顺时针自1开始顺序报数,报到m时停止报数。报m的人出列,将他的密码作为新的m值,从它在顺时针方向上的下一个人开始重新从1报数,如此下去直到所有人全部出列。
三、 需求分析
输入m=20;n=7,7个人的密码依次是:3,1,7,2,4,8,4,出列顺序为:6,1,4,7,2,3,5。
-experiment a subject Josephus, the experiment used a cycle chain to achieve Joseph Central 2. Experiment No. 1, 2, ..., n, n personal sequential anti-clockwise direction sitting around a circle and each person eating a password. An optional began as a whole reported a few limits on m, started from the first clockwise from the beginning of a sequence of several reported, m report reportedly stopped a few. M reported from the series of his password as a new value m, from it in a clockwise direction for the next re-started from a few reported that more until the total of all out. 3, needs analysis input m = 20; N = 7,7 personal password in order, are : 3,1,7,2,4,8. 4 out out in chronological order : 6,1,4,7,2,3,5.
相关搜索: 约瑟夫环
(系统自动生成,下载前可以参看下载内容)
下载文件列表
yuecefuhuan.doc