  /* postcondition: Returns the subscript of the first element
   *   of its array argument that stores the target value.
   *   Returns -1 if target is not found.
   */ 
  public static int search(int[] x, int target) {
     for (int i = 0; i < x.length; i++) {
        if (x[i] == target)
           return i;        //index of target
     }

     // All elements tested without success.
     return -1;
  }
