public static int maxElement(int[] vals){
  if (vals.length == 0) {
    throw new NoSuchElementException("No Max Element in Empty Array.");
  }
  return maxElement(vals,0,vals.length);
}

public static int maxElement ( int [ ] vals ) { if ( vals . length == 0 ) { throw new NoSuchElementException ( "No Max Element in Empty Array." ) ; } return maxElement ( vals , 0 , vals . length ) ; }
return largest element in the array using helper method for divide and conquer .
