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.

Comments:
Shell sort is faster than O(N^2)
 
They've now added merge sort and quicksort as well!
 
This comment has been removed by the author.
 
Checkout other sorting programs here.....

Heap Sort in C

Bubble Sort in C

Insertion Sort in C

Selection Sort in C

Quick Sort in C
 
Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?