An interactive sorting algorithm visualizer built with C#, now featuring a modern WPF-based GUI. This application provides an intuitive way to learn and understand how various sorting algorithms work through real-time visualizations.
- Algorithms Supported:
- Bubble Sort
- Quick Sort
- Merge Sort
- Selection Sort
- Heap Sort
- Insertion Sort
- Dynamic Visualization:
- Bars represent the array elements.
- Colors:
- Gray: Default state.
- Red: Comparing elements.
- GreenYellow: Selected or currently active element.
- Interactive Controls:
- Start and stop buttons for controlling the execution.
- Algorithm selection via a dropdown menu.
- Customizable Execution Speed:
- Modify the delay globally to adjust visualization speed.
- Frontend: Windows Presentation Foundation (WPF)
- Backend: C# (.NET)
- Other Tools:
- LINQ for array manipulations.
- Multithreading with
Task
andCancellationToken
for smooth execution and interrupt handling.
- Clone this repository:
git clone https://github.com/luangrezende/algorithm-visualizer.git
- Open the project in Visual Studio.
- Build the solution to restore dependencies.
- Run the project.
- Launch the application: A WPF window with a dropdown for algorithm selection and Start/Stop buttons will appear.
- Choose an algorithm: Select your desired sorting algorithm from the dropdown menu.
- Click "Start": Watch the algorithm dynamically sort a randomized array of integers.
- Stop or restart: Use the Stop button to interrupt and reset the visualization.
- VisualizerCanvas: Displays the array as bars.
- Controls: Dropdown to select algorithms, and buttons to start or stop execution.
- Add more sorting algorithms (e.g., Radix Sort, Shell Sort).
- Implement array size customization.
- Provide detailed step-by-step textual explanations for each algorithm.
Contributions are welcome! To contribute:
- Fork this repository.
- Create a new branch:
git checkout -b feature/your-feature
- Commit your changes and push the branch.
- Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.