mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-24 04:54:21 +08:00
style: enable AvoidNestedBlocks
in checkstyle (#5228)
* enable style AvoidNestedBlocks * refactor after enable style AvoidNestedBlocks * fix clang * fix checkstyle * fix pmd --------- Co-authored-by: Samuel Facchinello <samuel.facchinello@piksel.com> Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
This commit is contained in:

committed by
GitHub

parent
87b17e0571
commit
cdb3affdd9
@ -33,28 +33,27 @@ public final class Sort012D {
|
||||
int temp;
|
||||
while (mid <= h) {
|
||||
switch (a[mid]) {
|
||||
case 0: {
|
||||
case 0:
|
||||
temp = a[l];
|
||||
a[l] = a[mid];
|
||||
a[mid] = temp;
|
||||
l++;
|
||||
mid++;
|
||||
break;
|
||||
}
|
||||
|
||||
case 1:
|
||||
mid++;
|
||||
break;
|
||||
case 2: {
|
||||
case 2:
|
||||
temp = a[mid];
|
||||
a[mid] = a[h];
|
||||
a[h] = temp;
|
||||
h--;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
||||
default:
|
||||
throw new IllegalArgumentException("Unexpected value: " + a[mid]);
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println("the Sorted array is ");
|
||||
for (int i = 0; i < a.length; i++) {
|
||||
|
Reference in New Issue
Block a user