Skip to content

Commit 4f4aa68

Browse files
authored
fix: align MaximumElement with project standards
1 parent 159088d commit 4f4aa68

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/main/java/com/thealgorithms/arrays/MaximumElement.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
package 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) {

0 commit comments

Comments
 (0)