Visualize & Master
Algorithms & Data Structures
Explore classic & modern sorting algorithms, efficient searching techniques, and interactive data structure visualizations — all with real-time step-by-step animation, comparisons, swaps, and Big-O metrics.
N-Queens
Select an algorithm and press Play to watch the search tree explore and backtrack.
Backtracking Algorithm Catalog
2 algorithms in this category. Click any card for detailed analysis.
N-Queens
UnstableN-Queens places n queens on an n×n board so that no two queens attack each other (no shared row, column, or diagonal). Backtracking places queens row by row and undoes placements that lead to dead ends.
Sudoku Solver
UnstableThe Sudoku solver fills every empty cell with a digit 1-9 such that each row, column, and 3×3 box contains every digit exactly once. Backtracking fills cells in order and undoes choices that violate the constraints.
Complexity & Performance Tradeoffs
Side-by-side comparison of Big-O time and space complexity characteristics across backtracking algorithms.
| Algorithm | Best Time | Average Time | Worst Time | Space Complexity | Stability |
|---|---|---|---|---|---|
| N-Queens | O(n!) | O(n!) | O(n!) | O(n) | Unstable |
| Sudoku Solver | O(9^(n²)) | O(9^(n²)) | O(9^(n²)) | O(n²) | Unstable |