Comparing Sorting Algorithms on Rainbow-Colored Bar Charts
Comparing Sorting Algorithms on Rainbow-Colored Bar Charts
Sorting algorithms put elements of a list in numerical order. This Demonstration shows how five different sorting algorithms rearrange numerical values shown as vertical bars. We compare the following algorithms in terms of the number of steps they take when rearranging the elements in a list: shell sort, bubble sort, insertion sort, cocktail sort, and bogosort (fixed at seven values because the time complexity demands too many steps for many elements).