public class SequentialSearch{ /** Finds a value in an array, using the linear search algorithm. @param a the array @param v the value to search @return the index at which the value occurs, or -1 if it does not occur in the array */ public static int search(int[] a, int v) { for (int i = 0; i < a.length; i++) { if (a[i] == v) return i; } return -1; } } //