MCPcopy
hub / github.com/kunal-kushwaha/DSA-Bootcamp-Java / max

Method max

lectures/08-arrays/code/src/com/kunal/Max.java:29–40  ·  view source on GitHub ↗
(int[] arr)

Source from the content-addressed store, hash-verified

27 }
28
29 static int max(int[] arr) {
30 if (arr.length == 0) {
31 return -1;
32 }
33 int maxVal = arr[0];
34 for (int i = 1; i < arr.length; i++) {
35 if (arr[i] > maxVal) {
36 maxVal = arr[i];
37 }
38 }
39 return maxVal;
40 }
41}

Callers 13

countSortHashMethod · 0.45
radixSortMethod · 0.45
insertMethod · 0.45
rightRotateMethod · 0.45
leftRotateMethod · 0.45
insertMethod · 0.45
verticalTraversalMethod · 0.45
heightMethod · 0.45
helperMethod · 0.45
getMaxMethod · 0.45
twoStacksMethod · 0.45
mainMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected