views:

168

answers:

7

I am currently learning a number of different sorting algorithm. being curious with the differences,I tried to find the information of them but none is good enough. so here is my questions, in term of performance and their concept, what is the differences among bubble sort, selection sort, insertion sort, shell sort and quick sort.

+4  A: 

Wikipedia gives good brief descriptions of the popular sorting algorithms, as well as comparisons of their speeds.

Shmoopty
+1  A: 

Wikipedia has a nice table which compares a lot of sorting algorithms. Take a look here: http://en.wikipedia.org/wiki/Sorting_algorithm

nandokakimoto
+2  A: 

http://vision.bc.edu/~dmartin/teaching/sorting/anim-html/all.html is by far the best visual explanation of the sorting algorithms.

Tom Leys
A: 

Rule of thumb: QuickSort best, BubbleSort worst. Except of course when dealing with the exceptions.

jeffamaphone
+1  A: 

I like this animated sorting algorithm page that describes the differences between several sorts with several different inputs.

Alex B
+1  A: 

I'd start here and check the main article pages for each of the sorting methods you are interested in.

Tal Pressman
+4  A: 

Wikipedia doesn't mention the incredible timsort, which is what Python uses (a clever variant of Natural Mergesort). When one of my Pythonista colleagues presented it in a tech talk, my other colleague Josh Bloch, a Java guru, was so enthused he started coding it for Java then and there on his laptop -- apparently it will likely become the standard Java sort in some near-future version of the JVM;-)

Alex Martelli
+1 Learned something new today, and I am already a python enthusiast
Tom Leys
@Tom, great to hear I've been helpful -- thanks for letting me know!
Alex Martelli
A smart person can give ok answer to smart question, a wise person can give good answer to good question, a sage can give brilliant answer to dumb question.
ilya n.