Java Reference
In-Depth Information
(a)
(b)
F
IGURE
22.14
The program finds the largest block of 1s.
***22.20
(
Game: multiple Sudoku solutions
) The complete solution for the Sudoku prob-
lem is given in Supplement VI.A. A Sudoku problem may have multiple solu-
tions. Modify Sudoku.java in Supplement VI.A to display the total number of
the solutions. Display two solutions if multiple solutions exist.
***22.21
(
Game: Sudoku
) The complete solution for the Sudoku problem is given in
Supplement VI.C. Write a program that lets the user enter the input from the
text fields, as shown in Figure 22.15a. Clicking the
Solve
button displays the
result, as shown in Figure 22.15b-c.
(a)
(b)
(c)
F
IGURE
22.15
The program solves the Sudoku problem.
***22.22
(
Game: recursive Sudoku
) Write a recursive solution for the Sudoku problem.
***22.23
(
Game: multiple Eight Queens solution
) Write a program to display all possible
solutions for the Eight Queens puzzle in a scroll pane, as shown in Figure 22.16.
For each solution, put a label to denote the solution number. (
Hint
: Place all
solution panes into an
HBox
and place this one pane into a
ScrollPane
.)
**22.24
(
Find the smallest number
) Write a method that uses the divide-and-conquer
approach to find the smallest number in a list.
Search WWH ::
Custom Search