Merge 633aada3feb6fd740debcc6897c6e066ee7f8767 into d51971aa50fae33b2e65d1ae94c346540a6df93d

This commit is contained in:
Stanton 2018-07-05 22:47:00 +00:00 committed by GitHub
commit 9083d93150
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1532,10 +1532,10 @@ private boolean verify(int[] sequence, int first, int last)
return true;
int rootVal = sequence[last];
int cutIndex = first;
while (cutIndex < last && sequence[cutIndex] <= rootVal)
while (cutIndex < last && sequence[cutIndex] > rootVal)
cutIndex++;
for (int i = cutIndex + 1; i < last; i++)
if (sequence[i] < rootVal)
if (sequence[i] > rootVal)
return false;
return verify(sequence, first, cutIndex - 1) && verify(sequence, cutIndex, last - 1);
}