We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 159088d commit 4f4aa68Copy full SHA for 4f4aa68
1 file changed
src/main/java/com/thealgorithms/arrays/MaximumElement.java
@@ -1,17 +1,21 @@
1
package com.thealgorithms.arrays;
2
3
/**
4
- * This class provides a method to find the maximum element in an array.
+ * Finds the maximum element in an array.
5
*/
6
-public class MaximumElement {
+public final class MaximumElement {
7
+
8
+ private MaximumElement() {
9
+ // utility class
10
+ }
11
12
- * Finds the maximum value in the given array.
13
+ * Returns the maximum element in the array.
14
*
- * @param arr the input array
- * @return the maximum element in the array
15
+ * @param arr input array
16
+ * @return maximum value
17
- public static int findMax(int[] arr) {
18
+ public static int max(int[] arr) {
19
int max = Integer.MIN_VALUE;
20
21
for (int num : arr) {
0 commit comments