搜索资源列表
shellsort111
- 附有本人超级详细解释(看不懂的面壁十天!) 一、 实际问题: 希尔排序(Shell Sort)是插入排序的一种。因D.L.Shell于1959年提出而得名。它又称“缩小增量分类法”,在时间效率上比插入、比较、冒泡等排序算法有了较大改进。能对无序序列按一定规律进行排序。 二、数学模型: 先取一个小于n的整数d1作为第一个增量,把文件的全部记录分成d1个组。所有距离为dl的倍数的记录放在同一个组中。先在各组内进行直接插人排序;然后,取第二个增量d2<d1重复上述的分组和
Y_TFun_Tournament
- 二叉树,堆排序模板,时间复杂度:为O(N*Log2(N))。空间复杂度: 2*N-1(个结点)
WinnerTree
- 常见的实现方法是使用两个数组, t[n-1]和e[n],数组e存放所有的参加排序的元素,在完全二叉树中是叶子结点,t[]存放 的是比赛的阶段性胜者的编号,再进行n趟比赛排序结束,时间复杂度是O(n*log2(n)), 其实我觉得也可以只通过一个数组A[2*n-1]也可以实现,只是标号的换算有点复杂而已. -Common implementation approach is to use two array, t [n-1] and e [n], the array storage
Template-Binary-Search
- The "binary search algorithm" is one of the quickest way for searching threw an array, the "linear search algorithm" makes "n" comparaisons for searching for an element inside a given array. The "binary search algorithm" only makes log2(n) comparais
main
- 找n个数中最大的k个数 平均时间复杂度O(N*log2 K)-Find the largest number of k n the number of average time complexity O (N* log2 K)
HEAPSORT
- 在计算机内部排序的各种算法中 ,用比较大小的方法进行排序时间耗费的最好特性为 O(nlog2 n) ,最坏情况下还会上升到 O(n2 ) [1] 。要达到其理论下界log2 n1≈ nlog2 n- 1.4 4 n是非常困难的。Hashsort 一种散列排序方法-The best features of the computer' s internal sorting algorithm, the sort of time-consuming method of comparative s
二叉树
- (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