This project provides a visual representation of the Bubble Sort algorithm using Java. It helps users understand how Bubble Sort works by showing the sorting process step-by-step.
- Visual representation of the Bubble Sort algorithm
- Step-by-step sorting process
- Options to sort in ascending or descending order
- User-friendly interface with control buttons to navigate through sorting steps
- Java Development Kit (JDK) 8 or later
- An IDE or text editor of your choice
- Clone the repository to your local machine:
git clone https://github.com/amritBskt/Bubble-Sort-Visualization.git
- Navigate to the project directory:
cd Bubble-Sort-Visualization
- Open the project in your IDE or text editor.
- Compile the Java file:
javac BubbleSortVisualization.java
- Run the application:
java BubbleSortVisualization
- Launch the application.
- Enter the size of the array and the array values in the respective fields. Alternatively, you can directly enter the array values separated by commas.
- Select the order of sorting (ascending or descending).
- Click the "Run" button to start the sorting visualization.
- Use the left (◀) and right (▶) buttons to navigate through the sorting steps.
- Click the "Reset" button to reset the application and start over.
The main components of the project include:
- BubbleSortVisualization.java: The main class that creates the GUI and handles the sorting logic.
- GUI Components: Text fields, buttons, and panels for input, control, and visualization.
- Event Handling: Implements
ActionListener
to handle button clicks. - Sorting Logic: Implements Bubble Sort with intermediate steps stored for visualization.
- Visualization: Updates the GUI to show each step of the sorting process, including comparisons and swaps.
- GitHub: amritBskt
- Email: your-amritbskt7@gmail.com