Microsoft Quick +插入 [英] Microsoft Quick+insertion

查看:82
本文介绍了Microsoft Quick +插入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



i开始知道微软通过使用8个元素的截止值b / b并继续插入来提高快速排序的效率

然后,任何人都有

关于它的详细信息

请联系我。

解决方案

Am写道:


我开始知道微软通过使用8个元素的截止值继续提高快速排序的效率然后,插入排序,有没有人有关于它的详细信息
请加入我。




这个问题在其中一个微软更加热门.public。*

新闻组。


我说:

hi <我知道微软提高了快速排序的效率
通过使用8个元素的截止值并继续插入排序然后,任何人都有这样的细节关于它的ils




我非常怀疑微软是否提出了这个

的改进。确实,他们使用它,但如果你认为这是他们的想法,

或者如果你想知道细节,我建议你检查艺术

计算机编程第3卷 - 排序和搜索,由Donald E Knuth撰写。


-

Richard Heathfield

Usenet是一个奇怪的地方 - dmr 29/7/1999
http://www.cpax.org.uk

电子邮件:rjh在上面的域名(但显然放弃了www)


Am写道:

我开始知道微软提高了快速排序的效率
通过使用8个元素的截止值并继续插入排序然后,任何人都有关于它的详细信息请联系我。




我怀疑这是微软的发明。查看Bentley McIlroy的

经典论文Engineering a Sort Function。软件---实践和

经验23(11):1249--1269,1993年11月。我找到了一个在线副本


http://www.enseignement.polytechniqu。 ..ngineering.pdf


此外,1992年的BSD Unix qsort实现以qsort

开头,如果是数字,则插入排序元素小于7:


void

qsort(void * a,size_t n,size_t es,

int( * cmp)(const void *,const void *))

{

char * pa,* pb,* pc,* pd,* pl,* pm,* pn;


if(n< 7){

for(pm =(char *)a + es; pm<(char *)a + n * es; pm + = es)

for(pl = pm; pl>(char *)a&& cmp(pl-es,pl)> 0;

pl - = es)

swap(pl,pl - es);

return;

}

/ *递归qsort实现继续这里* /


-

Diomidis Spinellis

代码质量:开源视角(Addison-Wesley 2006)
http://www.spinellis.gr/codequality


hi
i came to know that microsoft improved the efficiency of quick sort
by using a cutoff
of 8 elements and continuing with insertion sort then, do anybody have
the details about it
please contant me.

解决方案

Am wrote:

hi
i came to know that microsoft improved the efficiency of quick sort
by using a cutoff
of 8 elements and continuing with insertion sort then, do anybody have
the details about it
please contant me.



This question is more topical in one of the microsoft.public.*
newsgroups.


Am said:

hi
i came to know that microsoft improved the efficiency of quick sort
by using a cutoff
of 8 elements and continuing with insertion sort then, do anybody have
the details about it



I doubt very much whether it was Microsoft which came up with this
improvement. It is true that they use it, but if you think it''s their idea,
or if you want to know the details, I suggest you check "The Art of
Computer Programming Vol 3 - Sorting and Searching", by Donald E Knuth.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)


Am wrote:

i came to know that microsoft improved the efficiency of quick sort
by using a cutoff
of 8 elements and continuing with insertion sort then, do anybody have
the details about it
please contant me.



I doubt this is a Microsoft invention. Check out Bentley McIlroy''s
classic paper "Engineering a Sort Function". Software---Practice and
Experience 23(11):1249--1269, November 1993. I located an online copy
at
http://www.enseignement.polytechniqu...ngineering.pdf

Also, the 1992-dated BSD Unix qsort implementation starts with the qsort
with an insertion sort if the numebr of elements is less than 7:

void
qsort(void *a, size_t n, size_t es,
int (*cmp)(const void *, const void*))
{
char *pa, *pb, *pc, *pd, *pl, *pm, *pn;

if (n < 7) {
for (pm = (char *) a + es; pm < (char *) a + n * es; pm += es)
for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0;
pl -= es)
swap(pl, pl - es);
return;
}
/* Recursive qsort implementation continues here */

--
Diomidis Spinellis
Code Quality: The Open Source Perspective (Addison-Wesley 2006)
http://www.spinellis.gr/codequality


这篇关于Microsoft Quick +插入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆