A uni project that solves Sudoku puzzles using backtracking search.
You feed it a 9x9 grid and it finds the solution (or tells you there isn't one). Internally it uses a custom linked-list stack to manage the search states instead of recursion.
Java 8 or higher.
javac StackList.java SudokuState.java SudokuSolver.java
java SudokuSolverThen enter the grid row by row, using 0 for empty cells:
0 0 3 0 2 0 6 0 0
9 0 0 3 0 5 0 0 1
0 0 1 8 0 6 4 0 0
0 0 8 1 0 2 9 0 0
7 0 0 0 0 0 0 0 8
0 0 6 7 0 8 2 0 0
0 0 2 6 0 9 5 0 0
8 0 0 2 0 3 0 0 9
0 0 5 0 1 0 3 0 0
...
Authors: Daniel Pantyukhov & Valen