# the fastest algorthm to order?

Show 80 post(s) from this thread on one page
Page 1 of 2 12 Last
• 03-16-2004
the fastest algorthm to order?
what is the fastest algorithm to order an large amount of numbers?
Could someone write a simple example please? i've already tried bubble sort but it's extremly slow!!!:p
• 03-16-2004
kermit
lol

too many edits on this

yeah, have you looked into qsort? I was not sure if that was a good function for sorting numbers or not.
• 03-16-2004
sorry my mistake. is qsort ansi-c? it has to be Ansi-C!
• 03-16-2004
Prelude
>i've already tried bubble sort but it's extremly slow!!!
Bubble sort is second only to Bogo sort in suckiness.

>Could someone write a simple example please?
Check the contest forum. A recent thread has an implementation of quicksort.

>is qsort ansi-c?
Yes.
• 03-16-2004
kermit
well you will find it in stdlib.h, if that helps - yeah it is standard C
• 03-16-2004
XSquared
>>Bubble sort is second only to Bogo sort in suckiness.
And what is this 'Bogo sort' you speak of?
• 03-16-2004
Prelude
>And what is this 'Bogo sort' you speak of?
Take a deck of cards. Throw them in the air and let them fall to the floor. Check to see if they're sorted. Repeat until they are. That's the equivalent of Bogo sort.
• 03-16-2004
XSquared
Gah!

Nothing like O(&#8734) efficiency!
• 03-17-2004
Salem
I thought bogosort was O(N!)
• 03-17-2004
MrWizard
Radix sort is pretty fast, look it up.
• 03-17-2004
Magos
Bucket sort is pretty much the fastest sort, with a complexity of O(N). It uses huge amount of memory though, and is in most cases not practical especially when having duplicates.
• 03-17-2004
XSquared
Quote:

Originally posted by Salem
I thought bogosort was O(N!)
I'm just going by Prelude's description, so in the worst case it would be O(&#8734).
• 03-17-2004
Salem
Yeah, actually it doesn't have an O value as such.

It is a probablility, that being 1 : N! of actually coming up with the right answer in any given trial.
• 03-17-2004
WaltP
I wonder how many monkeys it would take to implement the bogo sort?
• 03-17-2004
Markallen85
depends how fast you want it one monkey could implement it just fine, except the monkey might die before completing the process.
Show 80 post(s) from this thread on one page
Page 1 of 2 12 Last