|
|
|
|
|
October 10th, 2003, 07:53 AM
|
|
Lieutenant General
|
|
Join Date: Nov 2002
Posts: 2,903
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
Re: 320.2! 301.5, 311.3, 65.4
In school I wrote little programs to demonstrate bubble sort, insert sort, and quick sort, but I don't remember anything about radix sort. I do recall that quick sort was way faster than bubble sort.
|
October 10th, 2003, 02:47 PM
|
Colonel
|
|
Join Date: Mar 2002
Location: Colorado
Posts: 1,727
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: 320.2! 301.5, 311.3, 65.4
The following link has been rated Sure, Why Not for mild content.
|
October 10th, 2003, 05:02 PM
|
Colonel
|
|
Join Date: Mar 2002
Location: Colorado
Posts: 1,727
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: 320.2! 301.5, 311.3, 65.4
Gratuitous Double Post
major
|
October 10th, 2003, 07:01 PM
|
|
Major General
|
|
Join Date: Oct 2002
Posts: 2,174
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: 320.2! 301.5, 311.3, 65.4
Quote:
Originally posted by Kamog:
In school I wrote little programs to demonstrate bubble sort, insert sort, and quick sort, but I don't remember anything about radix sort. I do recall that quick sort was way faster than bubble sort.
|
Which sort is best depends on a lot of things; bubble sort is O(n^2) (n: number of data elements to be sorted) for its worst case - the element that is supposed to be first is in the Last position. Its best case, an already sorted list, allows it to have a trapdoor and do the "sort" in O(n). Insertion and selection sort are also O(n^2) in the worst case. Quicksort is, in the average case, O(n*lg(n)), but O(n^2) in its worst case. Mergesort is always O(n*lg(n)), as is Heapsort. All of the above sorts are based on comparisons.
Radix sort is a different beast entierly - it isn't based on comparisons, it is based on indexing. You need to know certain things about the data you are sorting to make it work (type, bit significance order, data length), but given those, it does the sort in O(k*n) (k is the maximum data element length). How it works: You make a set of stacks based on how many chunks you want to cut your sort key up into, and label them by the value that particular chunk represents (e.g., if you were sorting byte arrays, you might go with 256 stacks, numbered 0-255 - you may want an additional stack if your list elements aren't all the same length - a 'beyond bounds' stack). You then take each list element, and put it on the stack representing that list element's least significant chunk. When you are finished stacking the list, you put those stacks back into the list in a particular order, and stack them from the list again, using the next least significant chunk of your sort key. You continue this process until you have gone through the entire sort key, and gather them up; the list will then be sorted. It is a totally bizzare sorting algorythm, but it works.
__________________
Of course, by the time I finish this post, it will already be obsolete. C'est la vie.
|
October 14th, 2003, 09:59 PM
|
Private
|
|
Join Date: Jun 2003
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: 320.2! 301.5, 311.3, 65.4
Wha?
__________________
<img src=http://www.danasoft.com/sig/ alt= - /]
|
October 14th, 2003, 11:30 PM
|
Colonel
|
|
Join Date: Mar 2002
Location: Colorado
Posts: 1,727
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: 320.2! 301.5, 311.3, 65.4
|
October 14th, 2003, 11:44 PM
|
|
Colonel
|
|
Join Date: Feb 2001
Location: B.F.E. USA
Posts: 1,500
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: 320.2! 301.5, 311.3, 65.4
I see the "Name Changing Thread" is still alive!
__________________
Kill em all let God sort em out
|
October 15th, 2003, 12:52 AM
|
Colonel
|
|
Join Date: Mar 2002
Location: Colorado
Posts: 1,727
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: 320.2! 301.5, 311.3, 65.4
Only barely.
It could use a name change, too.
|
October 15th, 2003, 01:47 AM
|
|
Shrapnel Fanatic
|
|
Join Date: Mar 2003
Location: CHEESE!
Posts: 10,009
Thanks: 0
Thanked 7 Times in 1 Post
|
|
Re: 320.2! 301.5, 311.3, 65.4
*pulls out a complete life-support system*
comon, people! this is a great thread!
__________________
If I only could remember half the things I'd forgot, that would be a lot of stuff, I think - I don't know; I forgot!
A* E* Se! Gd! $-- C-^- Ai** M-- S? Ss---- RA Pw? Fq Bb++@ Tcp? L++++
Some of my webcomics. I've got 400+ webcomics at Last count, some dead.
Sig updated to remove non-working links.
|
October 15th, 2003, 02:57 AM
|
|
Major General
|
|
Join Date: Oct 2002
Posts: 2,174
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: 320.2! 301.5, 311.3, 65.4
*quietly replaces the oxygen bottle from the life support system with one with a small amount of laughing gas mixed in*
__________________
Of course, by the time I finish this post, it will already be obsolete. C'est la vie.
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is On
|
|
|
|
|