java - How to find the largest element locator in the case of a duplicate value -


I need to find the greatest element locator. This code works, but if I give the biggest element twice, So how can I return two locations?

  import java.util.Scanner; Public category's largest element locker {public static zero main (string [] ARG) // // Read the input from the console scanner input = new scanner (system.); System.out.print ("Enter the number of rows and columns of the array:"); // int lines for reading the number of rows = input.nextInt (); // read column number int columns = input.nextInt (); // Create new array object double [] [] A = new double [rows] [column]; // input array of elements System.out.println ("Enter the array:"); For (int i = 0; i  

The only way I can now think:

  1. Get the first number first.

  2. To find out the location of the larger elements once again through the array in the second instance. (Very little optimized approach though)

  3. Quick suggestions: You can type location class getter / setter For me, along with this you can create a hashase of all the places, which place objects objects.


Comments