Skip to content

Commit 7030bb4

Browse files
authored
Update MaximumElement.java
1 parent 709d91d commit 7030bb4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
package com.thealgorithms.arrays;
2+
3+
/**
4+
* This class provides a method to find the maximum element in an array.
5+
*/
26
public class MaximumElement {
7+
8+
/**
9+
* Finds the maximum value in the given array.
10+
*
11+
* @param arr the input array
12+
* @return the maximum element in the array
13+
*/
314
public static int findMax(int[] arr) {
415
int max = Integer.MIN_VALUE;
516

0 commit comments

Comments
 (0)