搜索资源列表
Josephus
- 解决约瑟夫问题的一个较为简单的例子的源代码。-Joseph problems to solve a relatively simple example of the source code.
Joson20121015
- 解决算法设计中的约瑟夫问题,用C++编写实现。程序中包含注释,具有较高的可读性。适合于初学者学习。-Solve the algorithm design Joseph C++ prepared to achieve. Included in the program notes, has a high readability. Suitable for beginners to learn.
Josephus
- 约瑟夫(Josephus)环问题:编号为1,2,3,…,n的n个人按顺时针方向围坐一圈,每人持有一个密码(正整数)。一开始任选一个正整数作为报数的上限值m,从第一个人开始按顺时针方向自1开始顺序报数,报到m时停止。报m的人出列,将他的密码作为新的m值,从他在顺时针方向上的下一人开始重新从1报数,如此下去,直到所有人全部出列为止。 建立n个人的单循环链表存储结构,运行结束后,输出依次出队的人的序号。(必须用链表)-Joseph (Josephus) Central question: numb
Joseph-problem-solving
- 这是一个<数据结构(C语言版本)>约瑟夫问题求解的一个小程序.-This is a <data structure (C language version)> Joseph problem solving a small program.
Joseph
- 设有n个人依围成一圈,从第1个人开始报数, * 数到第m个人出列,然后从出列的下一个人开始报数,数到第m个人又出列,…, * 如此反复到所有的人全部出列为止。设n个人的编号分别为1,2,…,n,打印出出列的顺序-Number,* the number of individuals out to the first m columns, and then start the next person reported that the number of columns, the number o
yuesefu
- 双向约瑟夫问题(顺时针再逆时针) n个人排成一个圆圈,从第一个人开始,先按顺时针方向,数m,数到m的人退出圆圈,然后从原有方向的下一个人开始,按原来顺序的反方向继续数m,依次数数,直到只剩最后一个人为止。比如有5个人,数3,则依次出去的人为3,1,4,5,2,最后的人是2号。现已知n和m,请问最后一个人的编号是多少?-Joseph problems bidirectional (clockwise then counterclockwise) n individual arranged i
