07reviewMultidimensionalArrays

07reviewMultidimensionalArrays - 7.4 with the following...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 7 Multidimensional Arrays 1 int[][] m = new int[4][5]; 2 Yes. They are ragged array . 3 array[0][1] is 2. 4. int[][] r = new int[2]; Answer: Invalid int[] x = new int[]; Answer: Invalid int[][] y = new int[3][]; Answer: Valid 5. Why does the is1To9 method need to copy list to temp ? Because we need to sort list. Sorting list will change the contents of list. This will change the contents of grid after invoking is1To9(grid[i]). What happens if you replace the code in lines 66-70 in Listing
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 7.4 with the following code: java.util.Arrays.sort(list); The contents in grid are changed. Consequently, you cannot check columns and small boxes using the altered grid . 6. int m = new int[4][6][5]; (Not in this edition) 7. False. Here is an example: 6 5 1 1 1 This input is valid, but there is no way to put 1 in the first 3 by 3 box....
View Full Document

Page1 / 2

07reviewMultidimensionalArrays - 7.4 with the following...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online