This project visualizes various sorting algorithms using a graphical user interface built with Java Swing. It allows users to observe the detailed working of several sorting algorithms through graphical bars, representing array elements, and provides insights into their complexity through on-screen text.
- Visualization of Sorting Algorithms: Bubble Sort, Insertion Sort, Selection Sort, Merge Sort, Quick Sort, and Heap Sort.
- Complexity Display: Dynamically shows the best, average, and worst-case complexities of selected algorithms.
- Speed Control: A slider that allows control over the visualization speed.
- Reset Functionality: Generates a new random array for fresh visualization.
- JDK 8 or later
- Clone/Download the repository.
- Navigate to the project directory.
- Compile the Java files:
javac *.java
- Run the
SortingFrame
class:
java SortingFrame
- Start Visualization: Click on the desired algorithm button to begin visualization.
- Adjust Speed: Utilize the slider for controlling the visualization speed.
- Reset: Click the "Reset" button to generate a new array and clear complexity information.
- Algorithm Complexity: View the best, average, and worst-case time complexities on the screen when an algorithm is running.
- Colors can be innaccurate for some algorithms
- Implementation of additional sorting algorithms.
- Enabling adjustment of the array size through GUI.