搜索资源列表
gap
- 最大间隙问题:给定n 个实数x , x , , xn 1 2 ,求这n 个数在实轴上相邻2 个数之间的最 大差值。假设对任何实数的下取整函数耗时O(1),设计解最大间隙问题的线性时间算法。
dynamic knapsack
- 该程序用动态规划解决经典的背包问题,虽然它的效率与分支定界法比起来,还是有一定的差距,但它的简洁性却是无与伦比的.-the program with dynamic programming solution to the classic knapsack problem, although its efficiency and branch and bound over, there is still a certain gap, but its simplicity is incomparab
xitong
- 通过实现哲学家进餐问题的同步深入了解和掌握进程同步和互斥的原理哲学家有N个,也定全体到达后开始讨论:在讨论的间隙哲学家进餐,每人进餐时都需使用刀、叉各一把,所有哲学家刀和叉都拿到后才能进餐。哲学家的人数、餐桌上的布置自行设定,实现刀和叉的互斥使用算法的程序实现。-Philosophers have N, is also scheduled to discuss after all reach: the gap in the discussion of dining philosophers, e
seal-sort
- 设计一算法,用希尔排序方法对n个原始数据进行排序。要求如下: 输入:(1)输入原始数据个数n; (2)输入n个原始数据。 输出:(1)输出原始数据; (2)输出增量gap及排序过程 (3)输出排序结果。-Design an algorithm, using the n Hill sorting method to sort the raw data. Requirements are as follows: Input:
max_gap_SA13006029
- 最大间隙问题的C语言源代码 计算机算法设计与分析中的题目-C language source code for a computer algorithm design and analysis topics maximum gap problem
ShellSort
- 首先取一个整数 gap < n(待排序记录数) 作为间隔, 将全部记录分为 gap 个子序列, 所有距离为 gap 的记录放在同一个子序列中 在每一个子序列中分别施行直接插入排序。 然后缩小间隔 gap, 例如取 gap = gap/2 重复上述的子序列划分和排序工作,直到最后取gap = 1, 将所有记录放在同一个序列中排序为止-First, take an integer gap < n (the number of records to be sorted) as t
二叉树
- (1)输出n=11时的判断树并求成功情况下的平均查找长度ASL; (2)通过构造判断树可以求得成功情况下的平均查找长度ASL1;当宝含有n个节点的判断树看成是一颗满二叉树是,其成功情况下平均查找长度的理论值ASL2约为log2(n+1)-1,对于n=10,100,1000,10000,100000和1000000,求出ASL1,ASL2两者的差距。((1) the judgment tree of the output n=11 and the average search length un