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

您现在的位置是:虫虫源码 > C# > Description : Let numbered 1, 2, ..., n (NGT; 0) clockwise direction by individu...

Description : Let numbered 1, 2, ..., n (NGT; 0) clockwise direction by individu...

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

资 源 简 介

描述:设编号为1,2,…,n(n>0)个人按顺时针方向围坐一圈,每人持有一个正整数密码。开始时任意给出一个报数上限值m,从第一个人开始顺时针方向自1起顺序报数,报到m时停止报数,抱m的人出列,从他在顺时针方向上的下一个人起重新自1起顺序报数;如此下去,直到所有人全部出列为止。要求设计一个程序模拟此过程,并给出出列人的编号序列。 .算法思想: Jeseph函数是实现问题要求的主要函数,其算法思想是:从1至m对带头结点的单循环链表循环计数,到m时,输出该结点的编号值,,再从该结点的下一个结点起重新自1起循环计数;如此下去,直到单循环链表空时循环过程结束。 -Description : Let numbered 1, 2, ..., n (NGT; 0) clockwise direction by individuals sitting around a circle, each holding a positive integer code. At the beginning of a given arbitrary reported few limits on m, started from the first clockwise direction from the starting sequence reported a few, when they report back m reported few, hold out the m out from the clockwise direction in the next personal re-order starting from a newspaper; This situation continues until all people so far shown up. Asked to design a simulation of this process, and give out the number of people out sequence. . Algorithm thinking : Jeseph function is to seek to achieve the main function of the algorithm is thinking : m f

文 件 列 表

josephus
Debug
w.c
w.ncb
w.plg
josephus报告.doc
w.dsp
w.opt
w.dsw
VIP VIP
0.185879s