文件名称:约瑟夫问题的实现
介绍说明--下载内容来自于网络,使用问题请自行百度
【问题描述】 设有n个人围坐在圆桌周围,现从某个位置m(1≤m≤n)上的人开始报数,报数到k的人就站出来。下一个人,即原来的第k+1个位置上的人,又从1开始报数,再报数到k的人站出来。依此重复下去,直到全部的人都站出来为止。试设计一个程序求出出列序列。 这是一个使用循环链表的经典问题。因为要不断地出列,采用链表的存储形式能更好地模拟出列的情况。-[n -- with the individuals sitting around the round table is from a certain location m (1 m n) of people reported the number of reported number of people who have come out. Next individuals, that the original clause k a position who reportedly started from a few, and reported that the number of people who come forward. Accordingly continue to repeat until all of the people come out so far. Test procedures designed sought out a sequence out. This is a use of recycled Chain classic problem. Due to the constant up and be using the storage form of Chain better simulate down.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
约瑟夫问题的实现.txt
www.dssz.com.txt
www.dssz.com.txt
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.