be placed in the bag. Here is a sample run:
In Chapter 22 bonus exercises, we will use dynamic programming techniques to solve
this problem efficiently.
*18.4 (Largest block problem) Programming Exercise 8.35 finds a largest block. Revise the
program to find the size of a largest block. Use the following recursive method to return the
size of the largest block whose upper left–corner is at (i, j):
public static int m(int i, int j)
Write a test program that prompts the user to enter the number of the matrix size and the values of the
matrix and displays the size of a largest block. Your program may find the size for every max
square at (i, j) and find their largest size. Here is a sample run:
In Chapter 22, we will use dynamic programming techniques to solve this problem
efficiently.
*18.5 (Largest block problem) Programming Exercise 8.35 finds a largest block. Revise the
program to find the top–left corner and the size of a largest block. Use the following recursive
function to return a Location object that have three data fields x, y, and size. Location is a
class with three public data fields x, y, size to store the location and size of a value 1 block. It
has a constructor Location(x, y, size) to create a Location object.
public static Location m(i, j)