文件名称:JosephusProblem
介绍说明--下载内容均来自于网络,请自行研究使用
约瑟夫问题的两种解法
设有n个人围坐在一个圆桌周围,先从第s个人开始报数,数到第m个人出列,然后从出列的下一个人重新开始报数,数到第m个人又出列……如此重复,直到所有的人出列为止。本程序分别用链式存储结构(循环链表)和顺序存储结构(数组)解决约瑟夫问题,可供初学者辨别这两种存储结构的异同
用户输入:n,s,m(逗号隔开)
输出:出列顺序表
-Joseph problems with n solution of two individuals sitting around in a round-table, starting with the first s individuals started off, a few individuals out to the first m out, and then a column from the next person to start off, a few to the first m another person out ... so ... repeat until all of the people out so far. This procedure, respectively, with chain storage structure (circular list), and the order of the storage structure (array) to resolve the issue of Joseph, for beginners to identify both the similarities and differences between storage structure user input: n, s, m (comma separated) output : out out the order form
设有n个人围坐在一个圆桌周围,先从第s个人开始报数,数到第m个人出列,然后从出列的下一个人重新开始报数,数到第m个人又出列……如此重复,直到所有的人出列为止。本程序分别用链式存储结构(循环链表)和顺序存储结构(数组)解决约瑟夫问题,可供初学者辨别这两种存储结构的异同
用户输入:n,s,m(逗号隔开)
输出:出列顺序表
-Joseph problems with n solution of two individuals sitting around in a round-table, starting with the first s individuals started off, a few individuals out to the first m out, and then a column from the next person to start off, a few to the first m another person out ... so ... repeat until all of the people out so far. This procedure, respectively, with chain storage structure (circular list), and the order of the storage structure (array) to resolve the issue of Joseph, for beginners to identify both the similarities and differences between storage structure user input: n, s, m (comma separated) output : out out the order form
(系统自动生成,下载前可以参看下载内容)
下载文件列表
约瑟夫问题
..........\约瑟夫问题-数组.cpp
..........\约瑟夫问题-链表.cpp
..........\约瑟夫问题-数组.cpp
..........\约瑟夫问题-链表.cpp