This app helps you *see* how a sort algorithm works, step by step.
Bubble Sort is considered one of the least efficient sorting algorithms. All it does is compare each element, one at a time, with every other element, and if that is bigger than the comparison, it swaps them. It has a performance rating of O(n2), meaning that if you have 100 elements, it will take 10,000 (100*100) steps to sort them.
Insertion Sort is a moderately efficient sorting algorithm. If the data is partially sorted, it can be quite fast. If it is totally random, it can take up to O(n2) but averages O(n1.5). On average, it would take 1,000 - 2,800 passes to sort 100 elements.
QuickSort is one of the most efficient sorting algorithm. It averages O(n * log n). On average, it would take 500 - 1,000 passes to sort 100 elements.
Marriage Sort is a highly efficient indeterminate sorting algorithm. It is indeterminate because a fully sorted array is never guaranteed. Like real life, elements search, one by one, for "better" (higher valued) elements, stopping once they get a good one and no much better ones are seen over the horizon. At its worse, it is O(n1.5) but it can achieve much better results far faster than even quicksort, independently of how random the elements are. On average, it would take 200 - 700 passes to get a 75% sorted array. Using an algorithm that works well with semi-sorted arrays (such as Insertion Sort) will then provide fully sorted arrays at just over the efficiency of QuickSort. However, Marriage Sort is by far one of the best algorithms yet invented when the number and/or values of elements are dynamic (adding and subtracting).