资源列表
这是一个将Dijkstra算法的时间复杂度
- 这是一个将Dijkstra算法的时间复杂度从O(n*n) 优化为O(nlogn)的方法,This method can reduce time complexity from O(n*n) to O(nlogn) for Dijkstra s algorithm.
构造两个带有表头结点的有序单链表
- 构造两个带有表头结点的有序单链表La、Lb,编写程序实现将La、Lb合并成一个有序单链表Lc。-Construct two header node with a single linked list ordered La, Lb, write a program to achieve the La, Lb merged into a single sorted list Lc.
循环单链表基本算法实现
- 循环单链表基本算法实现,如初始化,尾插法,输出,插入,删除等-Circulation single linked list of basic algorithms, such as initialization, the end of interpolation, output, insert, delete, etc.
实现顺序栈的各种基本运算
- 1、编写一个程序algo3-1.cpp,实现顺序栈的各种基本运算,并在此基础上设计一个主程序实现如下功能: (1)初始化栈S。 (2)判断栈S是否非空。 (3)依次进栈元素a,b,c,d,e。 (4)判断栈S是否非空。 (5)输出栈的长度。 (6)输出从栈顶到栈底的元素。 (7)输出出栈序列。 (8)判断栈S是否非空。 (9)释放栈 ,1, the preparation of a program algo3-1.cpp, the realization of
利用复数的输出方法将结果输出
- 1. 定义一个复数类Complex,该类有代表实部与虚部的成员变量,有两个构造函数Complex()与Complex(int x,int y)分别完成将成员变量初始化为0及给定值,另有计算复数的加减法及输出复数的三个方法,编程序利用该类完成2+3i与6-8i相加,12+9i与20-8i相减,并利用复数的输出方法将结果输出。,Define a complex number class Complex, the class is represented real and imaginary part
城市的信息带头结点的单链表
- 将若干城市的信息,存入一个带头结点的单链表。结点中的城市信息包括:城市名,城市的位置坐标。要求能够利用城市名和位置坐标进行有关查找、插入、删除、更新等操作。-Several cities in the information into a single linked list node to take the lead. Nodes in the city information including: city name, the city' s location coordinates. Re
马的Hamilton周游路线问题
- 马的Hamilton周游路线问题,---对于给定的偶数m,n≥6,且|m-n|≤2,编程计算m*n 的国际象棋棋盘一条马的Hamilton周游路线,Hamilton
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.