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

Method shrinkRight

java/Chapter 17/Question17_6/Question.java:33–41  ·  view source on GitHub ↗
(int[] array, int max_index, int start)

Source from the content-addressed store, hash-verified

31 }
32
33 public static int shrinkRight(int[] array, int max_index, int start) {
34 int comp = array[max_index];
35 for (int i = start; i < array.length; i++) {
36 if (array[i] >= comp) {
37 return i - 1;
38 }
39 }
40 return array.length - 1;
41 }
42
43 public static void findUnsortedSequence(int[] array) {
44 // find left subsequence

Callers 1

findUnsortedSequenceMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected