Please Help Create Method Java Programming Method Gethighestinrowindex Pass Two Dimensiona Q37122876

Please help me create this method. JAVA PROGRAMMING

Method getHighestInRowIndex – pass in atwo-dimensional ragged array of doubles and a row index and returnsthe index of the largest element in that row. Row index 0 is thefirst row in the array


Answer


public static int getHighestInRowIndex(double[][] data, int row) { int index = 0; for (int i = 0; i < data[row].length; ++i) { if (data[row][i] > data[row][index]) { index = i;

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.