Java program that visualizes the time complexity for the major sorting algorithms given randomized data.
Github Repo
# You will need to have Java version 8 install (SDK 1.8)
$ git clone https://github.com/ianramzy/sorting-comparison.git
# Import the project into your IDE of choice and setup the SDK as 1.8. (Note: it may work with other versions of Java, but is untested)
# Run the program from the GraphSortComparison.java class
I created this when I was first learning about time complexity and wanted to see how various algorithms performed when the number of items sort was increased.
It generates a new random seed each time and creates an unsorted list of 2000, 4000, 8000, and 16000 items. It then runs them through QuickSort, MergeSort, InsertionSort, BubbleSort, BetterBubbleSort and SelectionSort timing how long each one takes and graphing it.
I created this in a BlueJ Applet (Java).
In the future I would like to add even more sorting algorithms and perhaps add a feature where users could input how many items to be sorted with a slider and then see the comparison.
Another project by Ian Ramzy