File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/main/java/ru/algorithms Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments