Question: public static int[] getRow (int[] [] a, int i) { // returns row number i out of the specified array a[] [] // FIXME //
![public static int[] getRow (int[] [] a, int i) { //](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3bb26d0c67_19066f3bb264211b.jpg)
![returns row number i out of the specified array a[] [] //](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3bb27a50ca_19166f3bb2727af4.jpg)
public static int[] getRow (int[] [] a, int i) { // returns row number i out of the specified array a[] [] // FIXME // check that i is within range of valid indexes for a, else return null // return row (this is a one-dimensional array) public static int[] [] copy (int[] [] a) { // returns a copy of the specified array a [] [] // Assume each row in 'a' has the same number of columns // FIXME : make a new 2-D array the same dimensions as a // Row size is a.length. Column size is a [0].length // Fill the new array with contents of a // return the new array public static boolean equals (int[] [] a, int[] [] b) { // returns false unless the two arrays have the same dimensions // and the same elements at each position // FIXME: // if a does not have same number of rows as b, return false // In a nested loop, check that a and b have same number of columns, else return false // check that each a[i][j] is same as b[i][j], else return false // return true if all is well
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
