feat: add Sudoku Solver using Backtracking#7073
feat: add Sudoku Solver using Backtracking#7073DenizAltunkapan merged 5 commits intoTheAlgorithms:masterfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7073 +/- ##
============================================
- Coverage 78.46% 78.46% -0.01%
- Complexity 6730 6738 +8
============================================
Files 757 757
Lines 22324 22317 -7
Branches 4382 4380 -2
============================================
- Hits 17516 17510 -6
+ Misses 4107 4104 -3
- Partials 701 703 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@DenizAltunkapan could you please review into my PR, |
|
@Navadeep0007 what is the difference between your implementation and the existing one?https://github.com/TheAlgorithms/Java/blob/master/src/main/java/com/thealgorithms/puzzlesandgames/Sudoku.java |
|
@DenizAltunkapan Thank you for pointing out the existing implementation! I've reviewed Advantages of my implementation:
Trade-off:
I believe the test coverage alone adds significant value to the repository. Would you
Happy to adjust based on your preference! |
DenizAltunkapan
left a comment
There was a problem hiding this comment.
Thank you for your contribution @Navadeep0007!
Indeed, the new SudokuSolver class is cleaner, better structured, and focused on standard 9x9 Sudoku, which aligns well with the library's goals.
Therefore i recommend removing the old Sudoku class from the repository.
|
@DenizAltunkapan I've removed the old Sudoku class from the puzzlesandgames package as requested. The PR now includes:
|
|
@Navadeep0007 , you did not remove the https://github.com/TheAlgorithms/Java/blob/master/src/main/java/com/thealgorithms/puzzlesandgames/Sudoku.java file and its corresponding test class |
|
@DenizAltunkapan I've successfully removed both the old Sudoku.java file and its corresponding test class (SudokuTest.java) from the puzzlesandgames package. The PR now includes:
The branch is now up to date and ready for your review. Thank you for your guidance! |
Implemented Sudoku Solver using backtracking algorithm to solve 9x9 Sudoku puzzles.
Changes
SudokuSolver.javawith backtracking implementationSudokuSolverTest.javawith comprehensive test casesAlgorithm Explanation
Uses backtracking to:
Time Complexity: O(9^(nn)) worst case
Space Complexity: O(nn) for recursion stack