Format code with prettier (#3375)

This commit is contained in:
acbin
2022-10-03 17:23:00 +08:00
committed by GitHub
parent 32b9b11ed5
commit e96f567bfc
464 changed files with 11483 additions and 6189 deletions

View File

@ -66,7 +66,8 @@ public class BFPRT {
int offset = num % 5 == 0 ? 0 : 1;
int[] mArr = new int[num / 5 + offset];
for (int i = 0; i < mArr.length; i++) {
mArr[i] = getMedian(arr, begin + i * 5, Math.min(end, begin + i * 5 + 4));
mArr[i] =
getMedian(arr, begin + i * 5, Math.min(end, begin + i * 5 + 4));
}
return bfprt(mArr, 0, mArr.length - 1, mArr.length / 2);
}
@ -119,7 +120,27 @@ public class BFPRT {
}
public static void main(String[] args) {
int[] arr = {11, 9, 1, 3, 9, 2, 2, 5, 6, 5, 3, 5, 9, 7, 2, 5, 5, 1, 9};
int[] arr = {
11,
9,
1,
3,
9,
2,
2,
5,
6,
5,
3,
5,
9,
7,
2,
5,
5,
1,
9,
};
int[] minK = getMinKNumsByBFPRT(arr, 5);
System.out.println(Arrays.toString(minK));
}