473,396 Members | 1,990 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Microsoft Quick+insertion

Am
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.

Apr 15 '06 #1
11 2396
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.

Apr 15 '06 #2
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)
Apr 15 '06 #3
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
Apr 15 '06 #4
Am
thank you very much Diomidis ,please keep in touch i may need u r help

Apr 15 '06 #5
Am
great u write books!,I am using fedora core 2 can you suggest me an RPM
package to know the amount of time a program spends in a
particular part of the program.

Apr 15 '06 #6
Am wrote:
great u write books!,I am using fedora core 2 can you suggest me an RPM
package to know the amount of time a program spends in a
particular part of the program.


gprof

Susan L. Graham, Peter B. Kessler, and Marshall K. McKusick. An
execution profiler for modular programs. Software: Practice &
Experience, 13:671–685, 1983.
Apr 15 '06 #7
Am
gprof, but can you post the link if possible

Apr 16 '06 #8
"Am" <ma*********@gmail.com> writes:
gprof, but can you post the link if possible


www.google.com

And please read <http://cfaj.freeshell.org/google/>.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Apr 16 '06 #9
On 15 Apr 2006 23:12:00 -0700, in comp.lang.c , "Am"
<ma*********@gmail.com> wrote:
gprof, but can you post the link if possible


FCOL, STFW.
Mark McIntyre
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Apr 16 '06 #10
Am wrote:

gprof, but can you post the link if possible


Meaningless. Include adequate context. See below for how on the
broken google interface to usenet.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>
Apr 16 '06 #11
Diomidis Spinellis wrote:
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


It has at least one mistake concerning the c programming language.

This footnote is wrong in what it says
about the pointer to void type, compeling casting:

† We have used simple parameter declarations for readability.
The official prototype in the ANSI standard header file,
<stdlib.h>, is6
void qsort(void *, size_t, size_t, int (*)(const void *, const void *));
This declaration can be used no more honestly than ours.
The first argument compels casting in the source of qsort;
the last compels casting in programs that call it.

--
pete
Apr 20 '06 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: deancoo | last post by:
If I have a container, say a vector, with 5 elements, and I initialize iterator variables to point to the beginning and end of the container, are those iterators going to always be valid if I...
5
by: John N. | last post by:
Hi All, Here I have a linked list each containing a char and is double linked. Then I have a pointer to an item in that list which is the current insertion point. In this funtion, the user...
14
by: Roman Mashak | last post by:
Hello, All! Is there an easy way to determine that array e.g. int X contains ordered items (for example, ascending), except running loop with comparison of items? It would be good to provide...
5
by: Am | last post by:
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...
4
by: Andrix | last post by:
Hi, I have a table with 20.000.000 of tuples. I have been monitoring the performance of the insertion and updates, but not convince me at all. The table have 30 columns, what and 12 of it, are...
6
by: Julia | last post by:
I am trying to sort a linked list using insertion sort. I have seen a lot of ways to get around this problem but no time-efficient and space-efficient solution. This is what I have so far: ...
13
by: ralphedge | last post by:
These sorts work fine on 100000 ints but if I go much higher they will both segmentation fault **************************MERGESORT********************* mergesort(int *a, int size) //a is...
1
by: =?Utf-8?B?TWljaGFlbCBCbHVtZW50aGFsLCBNQ1NFLCBNQ0FE | last post by:
I am writing a .NET 1.1 C# windows service that writes to a dedicated event log (not the application event log, but one that I created). I want to make full use of all the fields in an event log...
0
by: Jon Paal [MSMD] | last post by:
anyone have a quick example of using insertion point of data with MSWC.Tools ? e.g. how can I send data to "div" tag ? Set oTools = Server.CreateObject("MSWC.Tools" ) oTools.processForm...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.