# Find max number in 2D array?

• 06-30-2010, 04:14 PM
spatel14
Find max number in 2D array?
Does anyone know of a good way to find the max number in a 2D array?
• 06-30-2010, 04:20 PM
JosAH
Quote:

Originally Posted by spatel14
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
• 06-30-2010, 04:21 PM
spatel14
Quote:

Originally Posted by JosAH
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.
• 06-30-2010, 04:27 PM
JosAH
Quote:

Originally Posted by spatel14
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:

Code:

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

Jos