登录
首页 » 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...

于 2023-04-25 发布 文件大小:20.54 kB
0 136
下载积分: 2 下载次数: 1

代码说明:

描述:设编号为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

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • flash
    flash的一个小应用,只有一点代码,上课课件的制作(a small flash applications, only a little code, class courseware production)
    2013-05-17 09:30:14下载
    积分:1
  • gps
    gps数据采集代码。 vc++6.0编写(gps data acquisition code. vc++ 6.0 preparation)
    2008-04-07 20:50:24下载
    积分:1
  • 04-Buzzer
    STM30F103 buzzer example
    2015-04-20 19:08:05下载
    积分:1
  • sgatus_lonkitudinal
    NXP LPC1768作为实验平台,方便各位在不同软件平台下测试使用网络()
    2018-03-18 19:55:58下载
    积分:1
  • VC++ ADO & Access Demo
    VC++ ADO & Access Demo
    2023-01-27 10:35:04下载
    积分:1
  • C# 绘制圆形、矩形、三角形 实例
    GDI实例3,绘制圆形、矩形等图形
    2013-02-10下载
    积分:1
  • MFCThread
    MFC创建线程,终止线程,暂停线程,继续线程(MFC to create threads, terminate threads, suspended thread to continue the thread)
    2010-05-26 23:39:34下载
    积分:1
  • sunearthmoon
    VS2010环境下MFC中的OpenGL写的太阳地球月亮转动模型(model of the sun earth moon rotation with MFC in VS2010 environment written by OpenGL)
    2011-12-30 16:31:58下载
    积分:1
  • d.s.
    说明:  data structure objective type questions.
    2019-05-30 13:22:31下载
    积分:1
  • 对初学者有用的全视频教程.不过内容感觉比较空洞.
    对初学者有用的全视频教程.不过内容感觉比较空洞.-Useful for beginners-wide video tutorials. But compare the contents of an empty feeling.
    2022-03-28 19:08:54下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载