mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-27 06:23:08 +08:00
Add automatic linter (#4214)
This commit is contained in:
@ -49,8 +49,7 @@ public final class QuickSelect {
|
||||
return selectIndex(list, 0, list.size() - 1, n);
|
||||
}
|
||||
|
||||
private static <T extends Comparable<T>> int selectIndex(
|
||||
List<T> list, int left, int right, int n) {
|
||||
private static <T extends Comparable<T>> int selectIndex(List<T> list, int left, int right, int n) {
|
||||
while (true) {
|
||||
if (left == right) return left;
|
||||
int pivotIndex = pivot(list, left, right);
|
||||
@ -65,8 +64,7 @@ public final class QuickSelect {
|
||||
}
|
||||
}
|
||||
|
||||
private static <T extends Comparable<T>> int partition(
|
||||
List<T> list, int left, int right, int pivotIndex, int n) {
|
||||
private static <T extends Comparable<T>> int partition(List<T> list, int left, int right, int pivotIndex, int n) {
|
||||
T pivotValue = list.get(pivotIndex);
|
||||
Collections.swap(list, pivotIndex, right);
|
||||
int storeIndex = left;
|
||||
|
Reference in New Issue
Block a user