An educational sorting algorithm visualizer built with .NET and WPF
Interactive, real-time visualizations designed for students, educators, and developers to understand how sorting algorithms work.
- Step-by-step visualization with real-time algorithm progression
- Performance metrics showing comparisons, swaps, and time complexity
- Multiple sorting algorithms with detailed analysis
- Customizable settings for array size, speed, and data patterns
- Clean, modern interface following Windows design guidelines
- Windows 10/11 (x64)
- .NET 8.0 SDK (for development) or Runtime (for running pre-built version)
- Download from Releases page
- Extract and run
AlgorithmVisualizer.exe
# Clone the repository
git clone https://github.com/luangrezende/algorithm-visualizer.git
cd algorithm-visualizer
# Restore dependencies and build
dotnet restore
dotnet build
# Run the application
dotnet run --project AlgorithmVisualizer.UI
Algorithm | Time Complexity | Space | Stability |
---|---|---|---|
Bubble Sort | O(n²) | O(1) | ✅ Stable |
Quick Sort | O(n log n) avg | O(log n) | ❌ Unstable |
Merge Sort | O(n log n) | O(n) | ✅ Stable |
Selection Sort | O(n²) | O(1) | ❌ Unstable |
Heap Sort | O(n log n) | O(1) | ❌ Unstable |
Insertion Sort | O(n²) | O(1) | ✅ Stable |
Each algorithm includes real-time visualization of comparisons, swaps, and current positions during sorting.
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature
- Make your changes and add tests
- Commit with clear messages:
git commit -m 'Add new feature'
- Push to your branch:
git push origin feature/your-feature
- Open a Pull Request
To add a new sorting algorithm:
- Create a new class implementing
ISortingAlgorithm
:
public class YourNewSort : ISortingAlgorithm
{
public string Name => "Your Algorithm Name";
public string Description => "Brief description";
public void Sort(int[] array, Action<int[], int, int> render,
CancellationToken cancellationToken)
{
// Your algorithm implementation
// Call render(array, currentIndex, comparedIndex) for visualization
}
}
- Register it in
SortingController.GetAvailableAlgorithms()
For bugs or feature requests, please open an issue.
This project is licensed under the MIT License - see the LICENSE file for details.
- .NET 8.0 - Modern framework
- WPF - Windows desktop application framework
- C# 12.0 - Latest language features
Made with ❤️ for students, educators, and developers