100% Guaranteed Results


BLG233E – Solved
$ 20.99
Category:

Description

5/5 – (1 vote)

BLG 233E DATA STRUCTURES AND LABORATORY

EXPERIMENT – SUDOKU CHECKER

IMPORTANT REMINDERS

1. It is not allowed to use USB sticks during the lab sessions.
2. You should unplug your ethernet cables during the lab sessions.

Experiment
In this experiment, you are supposed to write a program which controls whether a given sudoku is valid or not.
A Sudoku puzzle consists of 81 cells which are divided into nine columns, rows and regions. The task is to place the numbers from 1 to 9 into the empty cells in such a way that in every row, column and 3×3 region each number appears only once.
The program will read the given sudoku from an input file. Input file contains 81 integer numbers in 9×9 two dimensional matrix format. For example:

6 5 4 7 9 1 2 3 8
8 1 3 2 5 4 6 7 9
2 7 9 3 8 6 5 1 4
9 6 5 1 7 2 4 8 3
3 4 8 5 6 9 1 2 7
7 2 1 4 3 8 9 6 5
1 8 2 9 4 7 3 5 6
4 3 7 6 1 5 8 9 2
5 9 6 8 2 3 7 4 1

For this experiment, three different input files are prepared for testing: “sudoku1.txt”, “sudoku2.txt” and “sudoku3.txt”. Your code should work at least for these three test cases.
Pseudocode:
Step #1: The program reads the input file and stores these numbers in a 9×9 two dimensional array.
Step #2: The function which checks whether the given sudoku puzzle is valid or not is called.

Definition of the function is given as:

bool sudokuChecker(int sudoku[9][9])

Step #3: Based on the return value of the function, the status (valid or invalid) of the puzzle is printed to the console. As:
“The sudoku #1 is VALID” or “The sudoku #1 is INVALID”

Reviews

There are no reviews yet.

Be the first to review “BLG233E – Solved”

Your email address will not be published. Required fields are marked *

Related products