MCPcopy Create free account
hub / github.com/TheAlgorithms/Java / max

Method max

src/main/java/com/thealgorithms/sorts/BitonicSort.java:109–111  ·  view source on GitHub ↗

Finds the maximum element in the given array. @param the type of elements in the array, which must implement the Comparable interface @param array the array to be searched @return the maximum element in the array @throws IllegalArgumentException if the array is null or empty

(final T[] array)

Source from the content-addressed store, hash-verified

107 * @throws IllegalArgumentException if the array is null or empty
108 */
109 private static <T extends Comparable<T>> T max(final T[] array) {
110 return Arrays.stream(array).max(Comparable::compareTo).orElseThrow();
111 }
112}

Callers 15

sortMethod · 0.95
executeMethod · 0.45
sortMethod · 0.45
fillGridMethod · 0.45
radixSortMethod · 0.45
getNextGapMethod · 0.45
calculateNumBucketsMethod · 0.45

Calls 1

streamMethod · 0.80

Tested by

no test coverage detected