登录
首页 » Windows开发 » 本程序针对约瑟夫问题的描述:编号为12,……n的n个人按顺时针方向围成一圈,每人持有一个密码(正整数),一开始任选一个正整数作为报数上限值m,从第一个人开始按顺...

本程序针对约瑟夫问题的描述:编号为12,……n的n个人按顺时针方向围成一圈,每人持有一个密码(正整数),一开始任选一个正整数作为报数上限值m,从第一个人开始按顺...

于 2022-10-13 发布 文件大小:1.09 kB
0 153
下载积分: 2 下载次数: 1

代码说明:

本程序针对约瑟夫问题的描述:编号为12,……n的n个人按顺时针方向围成一圈,每人持有一个密码(正整数),一开始任选一个正整数作为报数上限值m,从第一个人开始按顺序时针方向自1开始顺序报数,报道m时停止报数,报m的人处列将他的密码作为新的m值,从他在顺时针方向上的下一个人开始重新从1报数,如此下去,直至所有人全部出列为止。利用单向循环链表存储结构模拟此过程,按照出列的顺序印出各人的编号。 演示程序以用户和计算机的对话方式执行,即在计算机终端上显示“提示信息”下,用户输入循环人数n和每人的密码。-This procedure description specifically for Joseph problem: The serial number is 12, ... The n n individual surrounds the ready-made one circle according to the clockwise sense , each person holds (positive integer) a password, one positive integer beginning to assume a post of selections is upper limits ms numbering off, direction starts the hour hand beginning from the first people according to order from 1 numbering off in proper order , stop numbering off when reporting m, the person place column reporting m looks on his password as new m value , the individual begins to number off again from 1 , getting down like this from his time as soon as going ahead in clockwise sense, until proprietor all till leaving self s place in the ranks.

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

发表评论

0 个回复

  • 养殖水质处理系统
    工厂化水产养殖过程中对水质的监控和处理,以确保高密度养殖环境中的水质安全。
    2022-06-19 13:06:58下载
    积分:1
  • Excel Importer
    1号机组;
    2022-02-02 00:32:28下载
    积分:1
  • 控制PC摄像头
    对摄像头进行连接打开等操作,对于PC的不同摄像头进行操作,只需要把摄像头ID进行改变即可
    2023-01-30 15:00:12下载
    积分:1
  • 一个简单算法,实现替换空格,希望大家可以多多交流,共同进步...
    一个简单算法,实现替换空格,希望大家可以多多交流,共同进步-A simple algorithm to replace the space
    2023-02-17 04:50:04下载
    积分:1
  • 进程通信
    c++ 进程通信demo,包括客户端,服务器vc6.0编写,包括共享内存,通道等直接编译exe 可直接运行 c++ 进程通信demo,包括客户端,服务器vc6.0编写,包括共享内存,通道等直接编译exe 可直接运行
    2022-05-05 21:48:21下载
    积分:1
  • 窗口杀手 在使用win2000/xp的时候现,老是出现n个输入法的窗口,不能关掉,又总在最上面,看着很不爽,就写了这个小程序来把他们关掉。 方法很简单,就是F...
    窗口杀手 在使用win2000/xp的时候发现,老是出现n个输入法的窗口,不能关掉,又总在最上面,看着很不爽,就写了这个小程序来把他们关掉。 方法很简单,就是FindWindow()在PostMessage(WM_CLOSE,...),没有技术含量,仅仅图实用而已。-window Win2000/xp killer in the use of the time found that there always n input window, we can not switch off, the total at the top, watching very quickly wrote a small procedure to them to switch off. It is very simple, FindWindow () PostMessage (WM_CLOSE etc. no technical content, it only practical plan.
    2023-03-02 12:10:03下载
    积分:1
  • array.h: 安全数组 linkedlist.h: 普通表 dclinkedlist: 双向循环链表 hashtable.h: 哈希表 binstree.h...
    array.h: 安全数组 linkedlist.h: 普通表 dclinkedlist: 双向循环链表 hashtable.h: 哈希表 binstree.h: 二叉搜索树 avltree.h: AVL 树 如果要存储集合(元素不可重复)并快速查找,最佳的是 binstree.h(二叉搜索树)。 如果要存储二维或更高维的表格,最佳的是 hashtable.h(哈系表)。AVL 树的插入成本非常高(删除函数也没有实现),但 AVL 的搜索效率极高,所以适用于在程序开始前初始化程-NOTE: array.h :secure array,linkedlist.h:common table, dclinkedlist:dual cycle linkedlist, hashtable.h:hash table binstree.h:binary search tree, avltree.h: AVL tree, if you want to store set(elements no repeating) and to lookup it swiftly,best is binstree.h(binary search tree).if you want to store two dimensions s or more dimensions s table,best hashtable.h(hash table).the cost of AVL tree s insertion is very high(delete function is not completed),but effiency of AVL tree s search is very high,so it is the same with initialize programme before beginning programme.
    2022-08-16 05:08:19下载
    积分:1
  • D3D纹理贴图
    应用背景一个简单的d3d纹理贴图。将一张图片纹理贴图到一个立方体上,并能实现鼠标控制任意拖动,旋转。一个简单的d3d纹理贴图。将一张图片纹理贴图到一个立方体上,并能实现鼠标控制任意拖动,旋转。关键技术 DRECT3D, 通过d3d创建纹理,并在窗口中显示  mfc. 在MFC单文档窗口显示 c++. 整个框架用C++语言编写 轨迹球 可实现旋转拖动等功能
    2022-02-24 19:35:51下载
    积分:1
  • 通信系统传输模型
    这是信息论与编码的作业,有3种信源编码方式,费诺编码、唯一可译码、香农码。 唯一可译码:若码的任意一串有限长的码符号序列只能被唯一地译成所对应的信源符号序列,则此码称为唯一可译码,否则,就称为非唯一可译码。 香农码:按不等式选择的码长所构成的码称香农码,香农码满足克拉夫特不等式。
    2022-05-09 14:36:43下载
    积分:1
  • 一个搞笑游戏,其中的算法很有意思,大家可以下载后玩一玩,但界面很垃圾,希望大家帮忙改改....
    一个搞笑游戏,其中的算法很有意思,大家可以下载后玩一玩,但界面很垃圾,希望大家帮忙改改.-a funny game, the algorithm is very interesting, you can download a play after play, but the interface is rubbish, we hope to help change it.
    2022-01-25 16:31:45下载
    积分:1
  • 696518资源总数
  • 106161会员总数
  • 5今日下载