Results 1 to 4 of 4
  1. #1
    spatel14 is offline Member
    Join Date
    Apr 2010
    Posts
    28
    Rep Power
    0

    Default Find max number in 2D array?

    Does anyone know of a good way to find the max number in a 2D array?

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,000
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by spatel14 View Post
    Does anyone know of a good way to find the max number in a 2D array?
    A 2 dimensional array is just a bunch of 1 dimensional arrays; you have to find the biggest number of all the maximums found in the 1 dimensional arrays.

    kind regards,

    Jos

  3. #3
    spatel14 is offline Member
    Join Date
    Apr 2010
    Posts
    28
    Rep Power
    0

    Default

    Quote Originally Posted by JosAH View Post
    A 2 dimensional array is just a bunch of 1 dimensional arrays; you have to find the biggest number of all the maximums found in the 1 dimensional arrays.

    kind regards,

    Jos
    Hey, right as I wrote this, I figure out how to do it, lol but thanks for the help.

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,000
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by spatel14 View Post
    Hey, right as I wrote this, I figure out how to do it, lol but thanks for the help.
    I'm in a good mood: you show me how to find the maximum in a one dimensional array, then I show you how to find the maximum in a two dimensional array. I want you to deliver a method like this:

    Java Code:
    int findMaximum(int[] array) { // find biggest number in 'array'
       // you write this method
    }
    kind regards,

    Jos

Similar Threads

  1. Finding a number in array close to another number
    By SteroidalPsycho in forum New To Java
    Replies: 2
    Last Post: 02-15-2010, 12:37 AM
  2. find the greatest and lowest number in 2D array
    By le_albina@hotmail.com in forum New To Java
    Replies: 2
    Last Post: 03-30-2009, 11:09 PM
  3. Find a number from a string
    By florentp in forum New To Java
    Replies: 2
    Last Post: 03-20-2009, 09:01 PM
  4. Replies: 8
    Last Post: 04-22-2008, 03:21 AM
  5. Find nth root of a number
    By perito in forum New To Java
    Replies: 1
    Last Post: 03-03-2008, 06:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •