| FRQs intro | 2d Array Nav & sort | 2d array conclusion |
FRQ - 2D Arrays
Free Response Question - 2018 2D Arrays
Explanation of the 2018 AP CSA FRQ - Question 4 (Part B)
Prior Knowledge
-
Helper Methods in the Problem
• getColumn(int[][] arr2D, int c): Returns an array containing all elements in column c of a 2D array.
• containsDuplicates(int[] arr): Returns true if the array contains duplicate values.
• hasAllValues(int[] arr1, int[] arr2): Returns true if all elements in arr1 are present in arr2.
-
Latin Square Definition
• The first row has no duplicate values.
• All values in the first row appear in every row of the square.
• All values in the first row appear in every column of the square.
-
Preconditions
• The input array is guaranteed to be square (equal number of rows and columns).
• At least one row exists in the array.