MCPcopy
hub / github.com/careercup/ctci / validate

Method validate

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

Source from the content-addressed store, hash-verified

19 }
20
21 public static boolean validate(int[] array, int left, int right, int pivot, int endLeft) {
22 for (int i = left; i <= endLeft; i++) {
23 if (array[i] > pivot) {
24 return false;
25 }
26 }
27 for (int i = endLeft + 1; i <= right; i++) {
28 if (array[i] <= pivot) {
29 return false;
30 }
31 }
32 return true;
33 }
34
35 public static boolean validateFull(int[] array) {
36 for (int i = 0; i < array.length; i++) {

Callers 1

validateFullMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected