Question: This question relates to understanding backtracking code solution that solves a sudoku puzzle. According to a quick Google search, Sudoku is a puzzle in which

This question relates to understanding backtracking code solution that solves a sudoku puzzle. According to a quick Google search, Sudoku is a puzzle in which players insert the numbers 1-9 into a grid consisting of nine squares subdivided into a further nine smaller squares in such a way that every number appears once in each horizontal line, vertical line, and square. The general input grid contains some numbers already placed in. The following figure shows the input and output outcome. Note: posOk is a method that checks if the number is in a valid spot and it runs in constant time. Also, the last parameter N is the size of the 2D board.
\table[[1,8,9,],[5,{f66c7d0f9-1ffe-4bb1-9ed0-0ba7d7b4deaa}
\table[[6,1]]\right\rvert,,2,],[,\table[[5,3]],,],[96,48,83,\table[[6,2,4,5,9,3,7,8,1]]],[3,6,51,],[1.,\table[[9,8,4]],46,\table[[3,4,8,2,6,7,1,9,5]]],[,75,,],[8,\table[[3,9]],7,],[,11,3,]]
for (int num =1; gum & 9; numt+)
if (posok(grid, row, col, num))
grid[row][ COl;
if (solveSudokuR (grid, ror, col +1,N)
J
return true;
r
grid [rOW][COl]=0;
}
return false;
Answer the following questions about the above code. For parts a-e you will write specific line numbers. Part f is a running time related question.
(c)(2 points) Which set of line(s) determines all the possible permutations
(d)(1 point) Which set of line(s) handles the bounds check?
(e)(1 point) Which set of line(s) updates the partial solution?
(f)(1 point) Whacks?
 This question relates to understanding backtracking code solution that solves a

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!