SortingSounds
Java application which visualizes three different sorting algorithms: bubble sort, quicksort and array sort, optionally playing a different tone to every comparison it makes while sorting.
The application contains 4 controls and a button responsible for the start of visualization.
- Sorting Method ChoiceBox allowing to choose between different sorting algorithms to visualize
- Latency Slider which can be manipulated during runtime allowing the user to change the speed of the animation
- Sample size ChoiceBox which lets the user choose different sizes of an array to be sorted
- Play Sound CheckBox responsible for determining if the sound should be played during visualization
In the botton there is a label which informs the user about how many comparisons chosen algorithm had made during sorting.
An example of the application running Bubble sort algorithm:
Quicksort:
Dual-Pivot Quicksort implemented in Java api as Arrays.sort() method:
To generate a jar file of this project using maven:
- after cloning the project, open terminal in the project’s main directory and type:
mvn package
- Next go to generated
target
directory:
cd target
- To run generated jar file enter:
java -jar SortingSounds.jar