登录
首页 » 数据结构 » 求解约瑟夫问题。设有n个人围成一个圆圈坐下,对所有围从的人从某个位置开始编号为1,2,3,……,n,从编号为1的人开始报数1,报数依交进行,报数n的人即出列,下...

求解约瑟夫问题。设有n个人围成一个圆圈坐下,对所有围从的人从某个位置开始编号为1,2,3,……,n,从编号为1的人开始报数1,报数依交进行,报数n的人即出列,下...

于 2022-05-21 发布 文件大小:7.84 kB
0 197
下载积分: 2 下载次数: 1

代码说明:

求解约瑟夫问题。设有n个人围成一个圆圈坐下,对所有围从的人从某个位置开始编号为1,2,3,……,n,从编号为1的人开始报数1,报数依交进行,报数n的人即出列,下一个人从1开始报数,再报数m的人便是第二个出列的人如此重复下去,直到最后一个人出列为止,于是便得到一个出列的顺序,这称之为约瑟夫(Josephu)问题。-solving problems. N individuals have formed a circle to sit down, all right Wai from the start from a position of No. 1, 2, 3, ..., n, for a number of people reported a few, according to several newspaper pay, the newspaper n ie the out, the next person was from the beginning a few , and reported m is the second out of this series continue to repeat until the final out in a series, then get a series out of order, which called Joseph (Josephu) problem.

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

发表评论

0 个回复

  • 文件检索
    数据结构实验六  统计若干个大型英文txt文件(如英文小说)中所有单词出现的次数,并输出出现次数最多的前10个单词及其出现次数。假设单词字符定义为大小写字母、数字和下划线,其他字符均看作单词分隔符。 要求: (1)自行设计合适的数据结构及相关算法; (2)程序运行结束时将txt文件名以及统计结果写入磁盘; (3)每次程序启动时(除了首次运行)将上次的结果读入内存、显示; (4)能根据用户选择实现重新初始化、查找某单词出现次数、追加统计、退出等功能。
    2022-01-26 00:14:54下载
    积分:1
  • 本人大学时编写的算法包括 堆栈 链表 及二叉树等。。。。。。很多很全...
    本人大学时编写的算法包括 堆栈数据结构 链表数据结构 及二叉树等。。。。。。很多很全-I am prepared by the university, including stack algorithm data structure Chain and binary tree data structure so. . . . . . The whole lot
    2022-07-13 02:51:00下载
    积分:1
  • 电影回顾
    movie review asp code
    2022-10-23 15:55:03下载
    积分:1
  • Nearest neighbor search algorithm, k_tree algorithm for most of the Chinese lite...
    最近邻搜索算法,k_tree算法的大部分中文文献-Nearest neighbor search algorithm, k_tree algorithm for most of the Chinese literature
    2022-01-26 06:16:31下载
    积分:1
  • Binary tree of various operations, including the establishment of binary tree, t...
    二叉树的各种操作,包括二叉树的建立,前序、中序、后序遍历二叉树,另外还包含一个霍夫曼编码的实现。-Binary tree of various operations, including the establishment of binary tree, the former sequence, in order, after the tree traversal, and also includes the implementation of a Huffman code.
    2022-03-04 10:15:52下载
    积分:1
  • (1)输入E条弧<j,k>,建立AOE
    (1)输入E条弧,建立AOE-网的存储结构 (2)从源点v出发,令ve[0]=0,按拓扑排序求其余各项顶点的最早发生时间ve[i](1=2). (4)根据各顶点的ve和vl值,求每条弧s的最早发生时间e(s)和最迟开始时间l(s).若某条弧满足条件e(s)=l(s),则为关键活动.-(1) E importation of Arc lt; J, kgt; Establish AOE- network storage structure (2) v starting point source, ve [0] = 0, by topological sorting point for the rest of the earliest timing ve [i] (1LT ; = ilt; = n-1). if the Topography vertex orderly sequence number is less than net n vertices, a statement that net presence in Central, not for Critical Path, algorithm implementation steps to terminate or (3) (3) from the Department of v starting point, Vl [n-1] = ve [n-1], by the inverse order for the remaining topology of the latest occurrence of peak time Vl [i] (n-inversion; = IGT; = 2). (4) According to the apex of ve and Vl value for each s arc of the earliest timing e (s) and the latest starting time
    2022-03-20 01:39:05下载
    积分:1
  • 四计算(语言课程设计
    四计算(c语言数据结构课程设计)
    2022-04-07 20:39:56下载
    积分:1
  • 输入您的生辰八字,程序会帮你算出你的一元周期的所有点
    输入您的生辰八字,程序会帮你算出你的一元周期的所有点-Enter your birthday character, the program will help you calculate your cycle of one dollar all point
    2022-02-14 08:20:42下载
    积分:1
  • 操作节点,非常好
    操作节点,非常好-operating nodes, a very good
    2022-02-05 23:46:51下载
    积分:1
  • vc下的ADO库编程
    vc下的ADO数据库编程-vc the ADO database programming
    2023-04-30 20:00:03下载
    积分:1
  • 696516资源总数
  • 106611会员总数
  • 19今日下载