Sorting Algorithms

Programming, for all ages and all languages.
Post Reply
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Sorting Algorithms

Post by qw »

Hi everybody,

Did you see this: http://youtu.be/kPRA0W1kECg? It's intriguing. Some I've never heard of before, like the bitonic sort. The bogo sort is painful to look at!
User avatar
bwat
Member
Member
Posts: 359
Joined: Fri Jul 03, 2009 6:21 am

Re: Sorting Algorithms

Post by bwat »

I was documenting a quantile function today and in my searches on the net came across a sorting algorithm that was completely new to me: Flashsort http://www.neubert.net/FSOIntro.html.

In the same language system that I implemented the quantile function, I have also implemented 3 different sorts: quicksort, merge sort, and topological sort. I can't see me offering any more. If the users need another algorithm, they can implement it themselves.

I reckon that 99% of the time programmers don't need anything other than your typical entry level textbook sorting algorithm and when they find themselves in the remaining 1%, a library function implementation probably won't do.

Edit: It would be interesting to know what algorithms others are using and why?
Every universe of discourse has its logical structure --- S. K. Langer.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Sorting Algorithms

Post by Combuster »

Both quicksort and mergesort have additional memory requirements and therefore not really befitting a kernel. In addition, the textbook implementation of quicksort is worst case on already sorted sets. Therefore if I actually need to implement a proper sorting algorithm, it typically ends up being either shellsort or heapsort.

Sorting turns out to be much too rare in practice compared to the time school puts in it.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
AndrewAPrice
Member
Member
Posts: 2299
Joined: Mon Jun 05, 2006 11:00 pm
Location: USA (and Australia)

Re: Sorting Algorithms

Post by AndrewAPrice »

I found merge sort to be fantastic when sorting linked lists - it doesn't require any extra memory.
My OS is Perception.
Post Reply