-
This programme helps you to find solution for any size of Sudoku. Not limited by size of Sudoku :)
-
Its time complexity is O(n^m) (n-possible values in single block, m-no. of empty block to fill).
-
Though it is O(n^m). Still you get solution much fast due to backtracking :)
-
Key Features:
- User can give any size grid.
- Uses Backtracking Algorithm, So very Fast.
- Easy to read Output.
- Entire code written in only C Programming Language.
- Also for standard Sudoku like 9x9 ,16x16,etc (which is a perfect square) gives unique value in subgrid. :)
-
Library Used:
- math.h for some arithmatic application
- stdlib.h for dynamic memory allocation for backtracking
- stdio.h for Input Output operation
-
How It works:
- First find empty location to filled.
- Then try all values iteratively possible for that
- If particular value obeys condition of grid, then call recursively for next empty cell.
- Goes till we don't get solution.
- If gets solution then return 1 and print the solution for given Sudoku.
- If no solution possible then return 0.
- If there is some error in input then return -1.
Dont forget to give star if you like it and feel useful :)