All pastes #353259 Raw Edit

Someone

public java v1 · immutable
·published 2007-02-13 07:49 UTC
rendered paste body
public class hi {	/**	 * @param args	 */	public static void main(String[] args) {						int[] TestArray = {30, 8, 31, 400, 1, 630, 70, 4, 7, 20};		hi h = new hi();		int smallest = h.minArray(TestArray, Integer.MAX_VALUE, 0);		System.out.println(smallest);	}	public int minArray(int[] array, int currSmallest, int stopIndex) //left to right	{		int localCurrSmallest = Integer.MAX_VALUE;		if (stopIndex == array.length-1)  //if at end of array, done		{			return array[stopIndex];		}		else		{			if (array[stopIndex] <  minArray(array, currSmallest, stopIndex+1))			{				localCurrSmallest = array[stopIndex];			}			else			{				localCurrSmallest = minArray(array, currSmallest, stopIndex+1);			}		}		return localCurrSmallest;	}}