Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

I have seen all the solutions of github and previous chegg answers. They dont work for me. So please do not copy from there as

I have seen all the solutions of github and previous chegg answers. They dont work for me. So please do not copy from there as this task requires different outputs. I will downvote if you copy the answer. I have all the solutions.

Write code in c language to validate a sudoku. Use concept of operating system. The major part will be done using threads. There are two phases of this task.

In the the first phase the output should be like this:

EXPECTED OUTPUT: Phase I Main thread will display the final result

Invalid boxes in the puzzle (Values and indexes)

Invalid rows (Values and indexes)

Invalid columns (Values and indexes)

Thread ID with each invalid output showing which thread has calculated the result.

Cancelled thread id (both threads IDs)

Comparison results of invalidation. (e.g., Row one has repeated value 3).

Total count of invalid entries.

Output statement showing that invalidation is because of invalid digits (less than 0 or greater than 9) or numbers are placed at invalid Locations.

Phase 2Sudoku Puzzle Solution

Phase 1 of this project is about the validation performed on the matrix (9 x 9). In phase 2, you must initialize a matrix with at least 2 invalid entries and provide its solution. You can store the matrix in a file. Each thread is assigned to each row and column and change the corresponding values if found erroneous. (Same as followed in phase 1). Solution of the sudoku puzzle, threads attributes must be initialized in start. So that Thread cancelation can be achieved. (As in solution thread has to swap the values with other threads, you need to keep track of changes. If a thread changes another threads value, thread dont allow to change its value it will cancel the other thread.) When a thread wants to swap the position of digits, it sends the signal to corresponding thread (Optional). Each thread must have a criterion to allow a thread to swap its position with other threads. Limited threads will be running using semaphores to balance the overhead and security issues, e.g., while updating the matrix no other thread will read the data. Threads should be created efficiently. After resolving the invalid entries, you must have to validate the solution and display the result.

EXPECTED OUTPUT: Phase II Main thread will display the following results:

Original and Resultant Puzzle in Matrix format.

Total invalid entries.

Threads created against each invalid entry.

No of moves for each invalid entry.

IDs of all threads with their ith indexes.

Location of invalid entry and its new position.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions