Description: 这是一个Josephus问题的C++代码,用双向链表实现.有问题题请联系ho1983xx@tom.com (2005-5-22,VC,1KB,下载0次)【向站长举报此文件和某个同类文件可能重复】-This a C++ code about Josephus problem, and use two-way chain form to realize.If you have any problem, please contact ho1983xx@tom.com Platform: |
Size: 2048 |
Author:zdw |
Hits:
Description: 用循环链表解Josephus问题。设有n个人围坐在一个圆桌周围,现从第1个人开始报数,数到第m的人出列,然后从出列的下一个人重新开始报数,数到第m的人又出列,…,如此反复直到所有的人全部出列为止。Josephus问题是:对于任意给定的n和m,求出按出列次序得到的n个人员的序列,如n=8,m=4时,输出序列是48521376。-cyclic Chain Solutions Josephus problem. N with the individuals sitting around a round table, it is from a few individuals reportedly began, a few of the m people out of ranks. Stand up and then the next person reported several fresh start, a few of the m out of the people out, ... so repeatedly until all of the people all out far out. Josephus question is : for any given set of n and m, sought out the out of order n is the sequence, if n = 8, m = 4, Sequence is 48521376. Platform: |
Size: 1024 |
Author:海薇 |
Hits:
Description: 约瑟夫环问题 采用C语言编写 没有用链表 而是用数组实现-Josephus problem using C language does not use chain instead of the array to achieve Platform: |
Size: 1024 |
Author:李 |
Hits:
Description: Josephus排列问题定义如下:假设n个竞赛者排成一个环形。给定一个正整数m,从某个指定的第一个人开始,沿环计数,每遇到第m个人就让其出列,且计数继续进行下去。这个过程一直到所有的人都出列为止。最后出列都优胜者。每个人出列的次序定义了整数1,2,...,n的一个排列。这个排列称为一个(n,m)Josephus排列。例如,(7,3)Josephus排列为3,6,2,7,5,1,4.对于给定的1,2,...n中的k个数,Josephus想知道是否存在一个正整数m(n,m)Josephus排列的最后k个数为事先指定的这k个数。-Josephus problem with the definition is as follows : Suppose n player formed a ring. Given a positive integer m, from a designated first started along the Central Counting that every individual section m let out their series and counting continued. This process has been to all of them from far out. Finally out from all the winners. Everyone out in the order shown in the definition of integers 1, 2 ,..., n an order. This arrangement known as a (n, m) Josephus arranged. For example, (7,3) Josephus order of 3, 6,2,7,5,1,4. For a given set of 1,2, ... n and k the number, Josephus would like to know whether there is a positive integer m (n, m) Josephus with the final number k prior to the designated number k this. Platform: |
Size: 2048 |
Author:诛仙 |
Hits:
Description: 数据结构实验(循环链表josephus问题)
学会选择合适的数据结构来解决实际问题
学会如何创建一个循环链表在循环链表中如何进行查找在循环链表中如何进行删除
-Experimental data structure (circular list Josephus problem) Institute of selecting suitable data structure to solve the practical problems to learn how to create a cycle in the cycle list list of how to carry out search in the cycle of how to delete list Platform: |
Size: 2048 |
Author: |
Hits:
Description: josephus问题源代码,c++ ,供大家参考,简明实用,大家可以借鉴使用。-Josephus problem of source code, c++, for your reference, concise and practical, we can learn from the use. Platform: |
Size: 44032 |
Author:tuantuan |
Hits:
Description: Josephus 排列问题定义如下:假设n 个竞赛者排成一个环形。给定一个正整数m,从某
个指定的第1 个人开始,沿环计数,每遇到第m 个人就让其出列,且计数继续进行下去。这
个过程一直进行到所有的人都出列为止。最后出列者为优胜者。每个人出列的次序定义了整
数1,2,…,n 的一个排列。这个排列称为一个(n,m)Josephus 排列。-Josephus with the problem are defined as follows: Suppose n a player lined up a ring. Given a positive integer m, from a designated section 1 begins with individuals along the ring count, the first m individuals, when confronted by their let out, and the count continued. This process until all the listed date. Finally a column for the winners. Each person listed in the order of the definition of the integers 1,2, ..., n an order. This arrangement is called a (n, m) Josephus arranged. Platform: |
Size: 1024 |
Author:刘丹 |
Hits:
Description: 约瑟夫斯(Josephus)问题的一种描述是:编号为1,2,…,n的n个人按顺时针方向围坐一圈,每人持有一个密码(正整数)。一开始任选一个正整数作为报数上限值m,从第一个人开始按顺时针方向自1开始报数,报到m时停止报数。报m的人出列,将他的密码作为新的m值,从他在顺时针方向下一个人开始重新从1报数,如此下去,直至所有的人全部出列为止。试设计一个程序,按出列顺序印出各人编号。-Josephus (Josephus) a description of the problem are: number 1,2, ..., n of n individuals sitting around a circle clockwise, each holding a password (positive integer). Choose a positive integer beginning as a limit on the number of reported m, starting from the first person to start a clockwise direction from a report number, report the number of reported m stop. Who reported m out of line, his password as the new m value, in a clockwise direction from the next person he began to re-reported from a number, it goes on until all the people all of the columns so far. Design a program, according to the column order prints each number. Platform: |
Size: 57344 |
Author:冯柳鑫 |
Hits:
Description: 约瑟夫问题
假设有n个小孩坐成一个环,假如从第一个小孩开始数,如果数到m个小孩,则该小孩离开,问最后留下的小孩是第几个小孩?
-The Josephus problem.Assuming n students sit in a ring.we start count from the first student.when we count m,the student who has the number of m musts leave.wo now ask the last one s number. Platform: |
Size: 5120 |
Author:zhangyue |
Hits:
Description: 约瑟夫问题(Josephus Problem)据说著名犹太历史学家 Josephus有过以下的故事:在罗马人占领乔塔帕特后,39 个犹太人与Josephus及他的朋友躲到一个洞中,39个犹太人决定宁愿死也不要被敌人到,于是决定了一个自杀方式,41个人排成一个圆圈,由第1个人开始报数,每报数到第3人该人就必须自杀,然后再由下一个重新报数,直到所有人都自杀身亡为止。 然而Josephus 和他的朋友并不想遵从,Josephus要他的朋友先假装遵从,他将朋友与自己安排在第16个与第31个位置,于是逃过了这场死亡游戏。   原题:   用户输入M,N值,N个人围成一个环,从0号人开始数,数到M,那个人就退出游戏,直到最后一个人 求最后一个剩下的人是几号?-The problem of Joseph (Josephus Problem) said that the famous Jewish historian Josephus had the following story: in the Romans occupied Qiaotapate, 39 Jews and Josephus and his friends hid in a hole, 39 Jews, the decision would rather die Do not be an enemy to, and decided a means of suicide, 41 individuals arranged in a circle by an individual number off each number off to the third person that the person must commit suicide, and then re-reported the number of the next until all have committed suicide, killed so far. However, Josephus and his friends do not want to comply with Josephus, to be the first to pretend to comply with his friends, he will be friends with their own arrangements in the 16 and 31 position, then escaped the death game. The original question: the user to enter M, N value, N, surrounded by a ring from No. 0 people began to count, count to M, that person will quit the game until the last person to ask the last one the rest of the people is ? Platform: |
Size: 199680 |
Author:liu |
Hits:
Description: 循环链表josephus问题。设有n个人围圈,现从第s个人开始报数,数到第m个人出列,然后从出列的下一个人从新开始报数,数到第m个人又出列,如此反复,直到所有人出列-Circular list josephus problem. Suppose there are n individuals in a circle, is from the first s individual reported the number of individuals out to the m-number column, and then the next person from the column and start again reported the number of individuals and the number to the m dequeue, and so forth, until Everyone out of the line Platform: |
Size: 3072 |
Author:taosq |
Hits: