|
2 | 2 |
|
3 | 3 | A program for visualizing sorting algorithms. |
4 | 4 |
|
5 | | -This is my freshman year summer project! :) |
| 5 | +This is my freshman year summer project! Trying to get a better understanding of sorting algorithms before my Data Structures and Algorithms class this fall while applying new things i've learned such as Swing, git, and multi-threading. |
6 | 6 |
|
7 | | -## Set up |
| 7 | +## Installation |
| 8 | + |
| 9 | +### Prerequisite |
| 10 | + |
| 11 | +*You must have a JDK installed on your system [Download JDK](https://www.oracle.com/java/technologies/javase-downloads.html)* |
| 12 | + |
| 13 | +- Clone he project onto your system 'https://github.com/dlarocque/AlgorithmVisualizer'. |
| 14 | +- Download the .zip file from https://github.com/dlarocque/AlgorithmVisualizer and extract its contents. |
| 15 | + |
| 16 | +*OR* |
| 17 | +- Download the Executable JAR file 'AlgVisualizer.jar'. |
| 18 | + |
| 19 | +## Running |
| 20 | + |
| 21 | +_Running through your IDE_ |
| 22 | + |
| 23 | +Open the project through your preferred IDE and run the AlgVisualizer.java file. |
| 24 | + |
| 25 | +_Running the Executable JAR_ |
| 26 | + |
| 27 | +Run AlgVisualizer.jar through the command line or simply execute the file through your folders. |
| 28 | + |
| 29 | +_Running through Terminal_ |
8 | 30 |
|
9 | | -You can either download the source code and run the application through your IDE or download the runnable JAR "AlgorithmVisualizer.jar" and run that. |
10 | 31 |
|
11 | 32 | ## How to use |
12 | 33 |
|
13 | | -On startup, the application will open a Frame containing an unsorted array of integers and buttons to reset, change the size of the array and select the sorting algorithm to visualize. |
| 34 | +On startup, the application will open up a frame containing buttons and an unsorted array in bar form. There is a Reset button, a button for each sorting algorithm, a drop down size changer, and a Performance button. |
14 | 35 |
|
15 | 36 |  |
16 | 37 |
|
17 | | -To change the size of the array being sorted, simply press the drop down menu that initially shows '10' as the array size. |
18 | | -The only available options are 10,50,100,200,400,800. |
| 38 | +_The Reset Button_ will re-shuffle the array and stop any sorting that is being done, while keeping the size set to the array. |
| 39 | + |
| 40 | +_The Sort Buttons_ will be available when sorting isn't being done. Clicking any of them will start sorting the displayed array with the selected sorting algorithm. |
| 41 | + |
| 42 | +_The Size Changer_ is initially set at N = 10, clicking it will open a drop down menu listing the available array sizes, clicking any of them will stop sorting and display a new array of the chosen size. |
| 43 | + |
| 44 | +_The Performance Button_ is available once a sorting algorithm has successfully sorted the array. Clicking it will open a window containing stats such as Index comparisons, swaps, Sorting Time, Visualization time. |
| 45 | + |
| 46 | +#### Notes |
| 47 | + |
| 48 | +The time to visualize the sorting of one of the algorithms is not a good representation of its real sorting time. This is because the frame / arr is updated every time there is an index swap, this makes it so that sorting algorithms with fewer swaps are visualized much faster. This is the reasoning behind including the 'Sorting Time' stat along with 'Visualzation Time' in the Performance window. |
| 49 | + |
| 50 | +The main window is not resizable due to the way that the bar graph is drawn. For example, if the width of the content pane is changed from 800 to 822, with an array N = 10, the drawing will not fill the entire window. Initially, the value of an index in the array was represented by an 80 inch wide bar, now it would be 82 and leaving a 2 pixel wide empty space in the frame. |
| 51 | +This is [Issue #15](https://github.com/dlarocque/AlgorithmVisualizer/issues/15) |
19 | 52 |
|
20 | | - |
| 53 | +## Authors |
21 | 54 |
|
22 | | - |
| 55 | +- Daniel La Rocque [dlarocque](https://github.com/dlarocque) |
23 | 56 |
|
24 | | -To begin sorting the array, simply click the algorithm you want to see visualized. |
25 | | -You can press the 'Reset' button to re-shuffle the array and stop sorting so that you are able to see another algorithm. |
| 57 | +## License |
26 | 58 |
|
27 | | - |
| 59 | +This project is licensed under the MIT License. See [LICENSE.txt](https://github.com/dlarocque/AlgorithmVisualizer/blob/master/LICENSE.txt) for more details |
28 | 60 |
|
29 | | -To see the sorting process slower, you can choose a larger array. |
| 61 | +## Issues |
30 | 62 |
|
31 | | -## Future updates |
| 63 | +If there is an issue with the application, please take a look at [issues](https://github.com/dlarocque/AlgorithmVisualizer/issues). If your issue is not already listed, please create a new issue that describes your problem! |
32 | 64 |
|
33 | | -- Add stats such as index swaps, accesses, and time elapsed. |
34 | | -- Make the window resizable for different resolutions. |
35 | | -- Make the sorting time depend on the systems capabilities to remove lag and delay between swapped indexes and the sorting. |
| 65 | +## Acknowledgments |
36 | 66 |
|
37 | | -## Known Bugs |
| 67 | +Inspiration for the project https://www.youtube.com/watch?v=kPRA0W1kECg |
38 | 68 |
|
39 | | -When a system has poor perfomance issues, there is some delay between the red and cyan bars displaying the swapped indexes and the sorting. |
40 | | -This is caused by the program not giving enough time to repaint the array, and sending in another chunk, putting the sorting out of sync with the list of swapped indexes. |
41 | 69 |
|
0 commit comments