Animated Sorting Algorithm – Which is best ? [ Math Fun ]

Ever wondered which sorting algorithm of Insertion, Selection, Bubble, Shell, Merge, Heap, Quick and Quick3 ? Well it might take some logic and you got to be good in mathematics but what I am going to show you next will just make you smile.

Animated Sorting Algorithm

This guys Dmartin has developed a small tool which allows you to play with all the algorithm at once after you select all the parameters. According to him “There is no algorithm that has these properties, and so the choice of the optimal sorting algorithm depends on the application.”

Pretty much right. It all depends whats your usage and requirement. He also explained the properties of an  ideal sorting algorithm :

  • Stable: Equal keys aren’t reordered.
  • Operates in place, requiring O(1) extra space.
  • Worst-case O(n·lg(n)) key comparisons.
  • Worst-case O(n) swaps.
  • Adaptive: Speeds up to O(n) when data is nearly sorted or when there are few unique keys.

This is worth noting down. So if you want to give it a try check out the Animated Sorting Algo


Please enter your comment!
Please enter your name here