User Name
Password

Go Back   Planetarion Forums > Non Planetarion Discussions > Programming and Discussion
Register FAQ Members List Calendar Arcade Today's Posts

Reply
Thread Tools Display Modes
Unread 20 Jul 2003, 00:12   #1
Scorpion-ice
Registered User
 
Join Date: Jul 2003
Location: Lincolnshire, UK
Posts: 15
Scorpion-ice is an unknown quantity at this point
Sorting algorithms

Which sorting algorithms would you say are the fastest when dealing with large amounts of data, I know Quicksort is fast (hense the name) but I know there are algorithms much faster, and if possible could anyone display some code(?) for it (preferrably in C/C++). It doesn't matter which language it is written in as I only want to see roughly on how it works. I have never really had to sort large amounts of data before so a bubble sort has always been alright to use.
__________________
Imperium et Respectus
Scorpion-ice
Scorpion-ice is offline   Reply With Quote
Unread 20 Jul 2003, 00:39   #2
Supernova9
m u p p e t
 
Join Date: May 2001
Location: Whenever Wherever
Posts: 477
Supernova9 is infamous around these parts
http://www.nada.kth.se/~snilsson/public/papers/sorting/
__________________
Supernova9 is offline   Reply With Quote
Unread 20 Jul 2003, 00:40   #3
queball
Ball
 
queball's Avatar
 
Join Date: Oct 2001
Posts: 4,410
queball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so little
yay a CS-y question

quicksort is considered the best general purpose sort. That doesn't mean anything for any particular case but you haven't given much information about your data. Would it be possible to keep it sorted in memory? Do you have any idea about the distribution of what you're sorting on? Whenever I've beaten a standard quicksort it's by using a quicksort variant or a sort very specific to the data (eg, a radix sort on evenly distributed numbers).

How large is large, what's the data, and what's the application? I need details!
queball is offline   Reply With Quote
Unread 21 Jul 2003, 10:18   #4
Cyp
∞+♪˛
 
Join Date: Nov 2000
Location: :uo!te]oŻ|
Posts: 428
Cyp is an unknown quantity at this point
http://www.wikipedia.org/wiki/Sort_algorithm lists a lot of sorting algorithms, and lists the complexity.

I don't recommend the bogosort, though.
__________________
Structural Integrity for Creator - since he'll probably make PA turn 3D.
Wikipedia forum
Note to self - Don't write Chinese letters with bold and italics...
<!--Last incarnation: Nov 2000-->
Cyp is offline   Reply With Quote
Reply



Forum Jump


All times are GMT +1. The time now is 21:39.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2018