Skip to content

Commit a054272

Browse files
committed
Formatted file
1 parent a3ebfcc commit a054272

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/java/ru/algorithms/BubbleSort.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
* Worst time: 0(n^2)
88
* Average time: 0(n^2)
99
* Best time: 0(n)
10-
*
10+
* <p>
1111
* Memory cost: 0(1)
1212
*
1313
* @param <T> Data type of array elements
1414
*/
15-
public class BubbleSort<T extends Number> implements Sorter<T>{
15+
public class BubbleSort<T extends Number> implements Sorter<T> {
1616

1717
/**
1818
* Just swap adjacent elements if they are in the wrong order
@@ -21,9 +21,9 @@ public class BubbleSort<T extends Number> implements Sorter<T>{
2121
*/
2222
@Override
2323
public void sort(T[] array) {
24-
for(int i = 0; i < array.length - 1; i++)
24+
for (int i = 0; i < array.length - 1; i++)
2525
for (int j = 0; j < array.length - i - 1; j++)
26-
if(array[j].doubleValue() > array[j + 1].doubleValue())
26+
if (array[j].doubleValue() > array[j + 1].doubleValue())
2727
SortingUtils.swap(array, j, j + 1);
2828
}
2929

0 commit comments

Comments
 (0)