subject

Public class Location {
private int row, col;

public Location( int r, int c )
{
row = r;
col = c;
}

public int row()
{
return row;
}

public int col()
{
return col;
}

public String toString()
{
return "(" + row + ", " + col + ")";
}

public boolean equals( Object x )
{
if ( x instanceof Location )
{
Location other = (Location) x;
return other. row == row && other. col == col;
}
return false;
}
}

import java. util. ArrayList;

public class Main
{
public static void main(String[] args)
{
String [][] m1 = { {"o","t","h","e", "r"}, {"t","e","e","t","h"}};
ArrayList locs1 = finde( m1 );
System. out. println( locs1 ); // [(0, 3), (1, 1), (1, 2)]

String [][] m2 = { {"n","o","t"}, {"n","o","w"} };
ArrayList locs2 = finde( m2 );
System. out. println( locs2 ); // []
}

public static ArrayList finde( String [][] a )
{
/* Returns an ArrayList of Locations where the letter e can be found in the 2D array.
You must traverse the String 2D array in row-major order.
Precondition: all of the strings have a length of one.
The array can be any size. */

return null;
}
}

Complete the finde method. It has one parameter, a 2D array of Strings, and returns an ArrayList of Locations where the letter e can be found in the 2D array. You must traverse the String 2D array in row-major order.

Remember to comment your program.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:40
When running anti-virus software , what could be a reason where recipitent is not guaranteed that data being streamed will not get interrupted?
Answers: 1
question
Computers and Technology, 24.06.2019 02:10
Consider the usual algorithm to convert an infix expression to a postfix expression. suppose that you have read 10 input characters during a conversion and that the stack now contains these symbols: (5 points) | | | + | | ( | bottom |_*_| now, suppose that you read and process the 11th symbol of the input. draw the stack for the case where the 11th symbol is
Answers: 2
question
Computers and Technology, 25.06.2019 06:00
In 2 to 3 sentences, describe how you would change the background of a group of cells
Answers: 1
question
Computers and Technology, 25.06.2019 08:10
Why should the technician watch for signs of contamination in the oil when recovering refrigerant from a system
Answers: 3
You know the right answer?
Public class Location {
private int row, col;

public Location( int r, int c )
Questions
question
Mathematics, 29.09.2020 22:01
question
History, 29.09.2020 22:01
question
Mathematics, 29.09.2020 22:01