File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
src/main/java/com/thealgorithms/arrays Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 11package com .thealgorithms .arrays ;
22
33/**
4- * This class provides a method to find the maximum element in an array.
4+ * Finds the maximum element in an array.
55 */
6- public class MaximumElement {
6+ public final class MaximumElement {
7+
8+ private MaximumElement () {
9+ // utility class
10+ }
711
812 /**
9- * Finds the maximum value in the given array.
13+ * Returns the maximum element in the array.
1014 *
11- * @param arr the input array
12- * @return the maximum element in the array
15+ * @param arr input array
16+ * @return maximum value
1317 */
14- public static int findMax (int [] arr ) {
18+ public static int max (int [] arr ) {
1519 int max = Integer .MIN_VALUE ;
1620
1721 for (int num : arr ) {
You can’t perform that action at this time.
0 commit comments