MCPcopy Index your code
hub / github.com/careercup/ctci / max

Method max

java/Chapter 18/Question18_6/QuestionC.java:65–71  ·  view source on GitHub ↗
(int[] array, int left, int right)

Source from the content-addressed store, hash-verified

63 }
64
65 public static int max(int[] array, int left, int right) {
66 int max = Integer.MIN_VALUE;
67 for (int i = left; i <= right; i++) {
68 max = Math.max(array[i], max);
69 }
70 return max;
71 }
72
73 public static int randomInt(int n) {
74 return (int) (Math.random() * n);

Callers 10

rankMethod · 0.95
printNodeInternalMethod · 0.80
maxLevelMethod · 0.80
heightMethod · 0.80
maxSubMatrixMethod · 0.80
maxSubArrayMethod · 0.80
checkHeightMethod · 0.80
getHeightMethod · 0.80
depthMethod · 0.80
magicFastMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected