Question: This is Data structure problem using java programmiing only. Look up the Wikipedia article on Sudoku puzzles at: https://en.wikipedia.org/wiki/Sudoku We will use the standard 9

This is Data structure problem using java programmiing only.

Look up the Wikipedia article on Sudoku puzzles at: https://en.wikipedia.org/wiki/Sudoku

We will use the standard 9 x 9 board with hints read from standard input. Your program should output the first solution discovered using a recursive algorithm that employs backtracking.

Note that depending on the number and value of the hints, there may be more than one solution or no solutions possible. Generally, Sudoku puzzles have hints that result in only one solution. For this reason, your program should read 81 values from standard input containing the hints (numbers in the input sequence between 1 and 9, inclusive) and empties (zeros in the input sequence). The input should fill the rows left-to-right then top-to-bottom. The values input should be taken from one of the many, easily available, Sudoku Puzzles (like the Wikipedia article) to be sure you will find a unique solution.

Notice that you can place the hints as a sequence in a white space delimited plain text file and read it as standard input to your program by using the following command line when launching your Java program:

java Sudoku < hints.txt Remember, all the digits from 1 through 9 need to be placed on each row and column (without any duplicates). Also, each of the nine 3 x 3 sub-grids on the board also need to have no duplicates of the nine digits.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!