Class SimpleArraySearch

java.lang.Object
  |
  +--SimpleArraySearch

public class SimpleArraySearch
extends java.lang.Object

Class SimpleArraySearch contains a single method to search for a number in an int-value array. The method uses a simple linear search algorithm.


Constructor Summary
SimpleArraySearch()
           
 
Method Summary
 int searchArray(int[] numbers, int value)
          Return the position in the given numbers array of the first occurance of the given numeric value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleArraySearch

public SimpleArraySearch()
Method Detail

searchArray

public int searchArray(int[] numbers,
                       int value)
Return the position in the given numbers array of the first occurance of the given numeric value. Return -1 if the element is not in the array or if the array is null.