12.4.11

Sorting algorithms as folk dances

Bubble sort, shell sort, insertion sort, and selection sort, each as a Hungarian, Romanian, or Gypsy folk dance. Alas, all the algorithms are O(n^2). I long to see an O(n log n) waltz, or better yet O(n) leaping into buckets. Spotted via Boing Boing.

5 comments:

Anonymous said...

Shell sort is faster than O(N^2)

Maurice said...

They've now added merge sort and quicksort as well!

Anonymous said...
This comment has been removed by the author.
Anonymous said...

1.Heap Sort in C
2.Bubble Sort in C
3.Insertion Sort in C
4.Selection Sort in C
5.Quick Sort in C

Anonymous said...

check out this Heap sort program in c. Here heap sort is explained with the help of diagram and pseudocode to insert and remove root from heap.