This is the visual implementation of sorting algorithms. this code covers the following algorithms:
The implementation generates random unsorted double array based on user input and generates output both for CLI 🖥️ and GUI 📊 using java StdDraw
library.
First of all, you should compile allSorts.java
file using this command:
> javac allSorts.java
And to run the app, just run the command below. it will give some help for usage:
> java allSorts
Help:
java allSort [Algorithm Name] [Count] {delay}
Algorithm Names:
bubble: Bubble Sort
selection: Selection Sort
insertion: Insertion Sort
quick: Quick Sort
merge: Merge Sort
shell: Shell Sort
Delay:
time for each compare to show graphics in Milisecond
> java bubble 20 100
> java selection 20 100
> java insertion 20 100
> java quick 20 100
> java merge 20 100
> java shell 20 100