资源列表
cPP 约瑟夫问题
- 1、约瑟夫问题的一种描述是:编号为1,2,3——,n的n个人按顺时针方向围坐一圈, 每个人持有一个密码(正整数)。一开始任选一个正整数作为报数上线值m,从第一 开始按顺时针方向报数,报到m时停止报数。报m的人出列,将他的密码作为新 的 m值,从他在顺时针方向上的下一个人重新开始从1报数,如此下去,直至所有人 全部出列。 2、程序运行后,首先要求用户指定初始报数上限值,然后读取个人的密码。可设n≤30。 3、测试数据:m=20;n=7;密码一次为:3,1
约瑟夫环循环报数链表
- M个人围成一圈,从第一个人开始依次从1到N循环报数,当报到N的时候此人出圈,直到圈中只剩一人为止.要求按退出顺序给出原始编号-M personal circle, starting from the first person in turn reported from 1 to N number of cycles, N, when the report when the person out circle, circle until only one person so far. Requir
常见算法及函数源代码
- 算法设计与分析 1. 用直接递归方法计算n!: (2)通过键盘输入n的值,( 2. 用直接递归方法计算第n个Fibonacci数: 3. 用直接递归方法计算Ackerman函数: 4. 用直接递归方法给出n个元素的全排列: 8. 用直接递归方法求解Hanoi塔问题 ,Algorithm Design and Analysis 1. Using direct recursive meth
用动态规划算法思想求最小编辑距离
- 用动态规划算法思想求最小编辑距离,即近似字符串匹配问题,Thinking of using dynamic programming algorithm for the minimum edit distance, that is, approximate string matching problem
顺序表算法实现,如初始化,尾插法
- 顺序表算法实现,如初始化,尾插法,输出,判断是否为空,插入元素,删除等-Sequence table algorithm, such as initialization, tail interpolation, the output, to determine whether the air, into the element, delete, etc.
合并两个升序排列的链表
- 合并两个升序排列的链表,主要是数据结构中链表的排序问题-Merge two linked list in ascending order, mainly linked list data structure in the scheduling problem
求任意n个数的平均值的程序
- 这是本人写的求任意n个数的平均值的程序,编程环境是Viasual C++ 6.0,可以直接运行,This is, I write for arbitrary n the average number of procedures, programming environment is Viasual C++ 6.0, can be directly run
dinic的网络最大流算法模板
- dinic的网络最大流算法模板,非常实用,经过自己多次测试通过的!Q,Dinic network maximum flow algorithm templates, very useful, after their own, adopted a series of trial runs! Q
学习c语言数据结构的有用库
- 学习c语言数据结构的有用库!!!帮助你提高C语言功力和代码效率,C language data structure to learn,a useful database! ! !
高斯-赛德尔迭代法解线性方程组的C++程序
- 这是高斯-赛德尔迭代法解线性方程组的C++程序,适合程序设计初学者和大学生课程设计-This is the Gauss- Seidel iterative method for solving linear equations of the C++ program, designed for beginners and students of the program curriculum design
Datastruct_C 实现顺序表的就地逆置
- Descr iption 试写一算法,实现顺序表的就地逆置,即利用原表的存储空间将线性表(a1,a2,…..an),逆置为( an,an-1, …….a2,a1)。 Input 输入长度n 接下来是n个数 Output 操作后的序列。 Sample Input 7 2 4 1 7 5 3 6 Sample Output 6 3 5 7 1 4
exp2_4 建立一个复数类imaginary
- 建立一个复数类imaginary,其私有数据成员x和y表示复数的实部和虚部,构造函数imaginary用于对复数的实部和虚部初始化,友员函数add,sub,mul和div分别用于进行复数的加、减、乘和除法运算,静态函数show用于显示运算结果。在主函数中,实例化两个复数,并输入一个运算符,按运算符选择相应的友员函数进行复数运算,然后输出运算结果。 -The establishment of a complex class imaginary, its private data member