首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > C# > 【问题描述】 设有n个人围坐在圆桌周围,现从某个位置m(1≤m≤n)上的人开始报数,报数到k的人就站出来。下一个人,即原来的第k+1个位置上的人,又从1开始报数...

【问题描述】 设有n个人围坐在圆桌周围,现从某个位置m(1≤m≤n)上的人开始报数,报数到k的人就站出来。下一个人,即原来的第k+1个位置上的人,又从1开始报数...

  • 资源大小:2.05 kB
  • 上传时间:2021-06-29
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: C# c++

资 源 简 介

【问题描述】 设有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
VIP VIP
0.170146s