shellpaixu

所属分类:Windows编程
开发工具:C/C++
文件大小:4KB
下载次数:0
上传日期:2019-03-04 14:58:32
上 传 者4597021
说明:   最坏时间复杂度为O(n^2);最优时间复杂度为O(n);平均时间复杂度为O(n^1.3)。辅助空间O(1)。稳定性:不稳定。希尔排序的时间复杂度与选取的增量有关,选取合适的增量可减少时间复杂度。 基本思想为在直接插入排序的思想下设置一个最小增量dk,刚开始dk设置为n/2。进行插入排序,随后再让dk=dk/2,再进行插入排序,直到dk为1时完成最后一次插入排序,此时数组完成排序。
(The worst time complexity is O (n ^ 2); the optimal time complexity is O (n); and the average time complexity is O (n ^ 1.3). Auxiliary space O(1). Stability: Instability. The time complexity of Hill sorting is related to the increment of selection, and the appropriate increment can reduce the time complexity. The basic idea is to set a minimum incremental DK under the idea of direct insertion sort, and at the beginning DK is set to n/2. The insertion sort is performed, then DK = Dk / 2 is allowed, and then the insertion sort is performed until the last insertion sort is completed when DK is 1, when the array completes the sort.)

文件列表:
shellpaixu.cpp (11119, 2019-03-04)

近期下载者

相关文件


收藏者