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, 23.06.2019 02:30
What is the power dissipated by a resistor with a current of 0.02 a and a resistance of 1,000 ? a. 200 w b. 20 w c. 0.4 w d. 4 w
Answers: 1
question
Computers and Technology, 24.06.2019 00:30
Setting up a home network using wireless connections is creating a a. vpn b. lan c. wan d. mini-internet
Answers: 2
question
Computers and Technology, 24.06.2019 03:30
Other - a written response, no less than arial 12-point font, to the following: of the following, which would you consider is most important to customer service goals? choose one and explain why. (1) accuracy (2) punctuality and attendance (3) courtesy (4) productivity (5) organization
Answers: 1
question
Computers and Technology, 24.06.2019 10:00
In which view can you see speaker notes?
Answers: 1
You know the right answer?
Public class Location {
private int row, col;

public Location( int r, int c )
Questions
question
Chemistry, 12.10.2019 16:10
question
Mathematics, 12.10.2019 16:10
question
Social Studies, 12.10.2019 16:10
Questions on the website: 13722360