An Improved HEAPSORT Algorithm with nlogn - 0.788928n Comparisons in the Worst Case

来源 :计算机科学技术学报(英文版) | 被引量 : 0次 | 上传用户:livos
下载到本地 , 更方便阅读
声明 : 本文档内容版权归属内容提供方 , 如果您对本文有版权争议 , 可与客服联系进行内容授权或下架
论文部分内容阅读
A new variant of HEAPSORT is presented in this paper. The algorithm is not an internal sorting algorithm in the strong sense, since extra storage for n integers is necessary. The basic idea of the new algorithm is similar to the classical sorting algorithm HEAPSORT, but the algorithm rebuilds the heap in another way. The basic idea of the new algorithm is it uses only one comparison at each node. The new algorithm shift walks down a path in the heap until a leaf is reached. The request of placing the element in the root immediately to its destination is relaxed. The new algorithm requires about n log n - 0.788928n comparisons in the worst case and n log n - n comparisons on the average which is only about 0.4n more than necessary. It beats on average even the clever variants of QUICKSORT, if n is not very small. The difference between the worst case and the best case indicates that there is still room for improvement of the new algorithm by constructing heap more carefully.
其他文献
An exfoliated layered double hydroxides/poly(methyl methacrylate) (LDHs/PMMA) nanocomposite was prepared by in situ solution polymerization of methyl methacryla
采用天冬单作、玉米单作和天冬 -玉米套作 3种种植模式 ,考查了整个生产过程中其主要生产资料和劳动力的投入以及产值等关键指标。对不同种植模式的经济效益对比分析结果表明
Mg-Al spinel is synthesized by using industrial waste-residue and basic magnesium carbonate in the aluminum factory as the main raw materials. The influence of
Global illumination effects are crucial for virtual plant rendering. Whereas real-time global illumination rendering of plants is impractical, ambient occlusion
A new mononuclear [Zn(H-1L)2] (L = 1H-indole-3-ethylene-salicylaldimine) was synthesized through the reaction of Zn(Ac)2, salicylaldehyde and tryptamine in hot
The influence of cold rolling reduction on microstructure and mechanical properties of the TWIP (ttwinning induced plasticity) steel was investigated. The resul
Reductive cleavage of the N-O bond of isoxazolidine ring with catalytic hydrogenation over Raney nickel was described.Bicyclic isoxazolidines could be effective
A new mononuclear Co(Ⅱ) complex, [Co(hmz)2(H2O)4]·2H2O, has been synthesized by the reaction of Co(CH3COO)2·4H2O with 1-(4-hydroxyphenyl)-5-mercaptotetrazole
为获得陆地棉黄萎病抗性相关候选基因,利用棉花黄萎病菌大丽轮枝菌V991毒素粗提物诱导耐黄萎病陆地棉品种‘中棉12应激基因的表达.在诱导幼根24 h时间点提取总RNA,PCR法合成
On the basis of the Local Equilibrium Model (LEM), fine particles with large Richardson-Zaki exponent n show, under certain conditions during bed expansion and