网站首页  英汉词典

请输入您要查询的英文单词:

 

单词 Introspective sort
释义

Introspective sort

中文百科

内省排序 Introsort

(重定向自Introspective sort)

内省排序(英语:Introsort)是由David Musser在1997年设计的排序算法。这个排序算法首先从快速排序开始,当递归深度超过一定深度(深度为排序元素数量的对数值)后转为堆排序。采用这个方法,内省排序既能在常规数据集上实现快速排序的高性能,又能在最坏情况下仍保持O(nlog n)的时间复杂度。由于这两种算法都属于比较排序算法,所以内省排序也是一个比较排序算法。

在快速排序算法中,一个关键操作就是选择基准点(Pivot):元素将被此基准点分开成两部分。最简单的基准点选择算法是使用第一个或者最后一个元素,但这在排列已部分有序的串行上性能很糟。Niklaus Wirth为此设计了一个快速排序的变体,使用处于中间的元素来防止在某些特定串行上性能退化为O(n^2)的状况。这个3基准中位数选择算法从串行的第一,中间和最后一个元素取得中位数来作为基准,虽然这个算法在现实世界的数据上性能表现良好,但经过精心设计的串行仍能大幅降低此算法性能。这样就有攻击者精心设计串行发送到因特网服务器以进行拒绝服务(DOS)攻击的潜在可能性。

英语百科

Introsort 内省排序

(重定向自Introspective sort)

Introsort or introspective sort is a hybrid sorting algorithm that provides both fast average performance and (asymptotically) optimal worst-case performance. It begins with quicksort and switches to heapsort when the recursion depth exceeds a level based on (the logarithm of) the number of elements being sorted. This combines the good parts of both algorithms, with practical performance comparable to quicksort on typical data sets and worst-case O(n log n) runtime due to the heap sort. Since both algorithms it uses are comparison sorts, it too is a comparison sort.

随便看

 

英汉网英语在线翻译词典收录了3779314条英语词汇在线翻译词条,基本涵盖了全部常用英语词汇的中英文双语翻译及用法,是英语学习的有利工具。

 

Copyright © 2004-2024 encnc.com All Rights Reserved
更新时间:2025/6/16 23:19:11