File tree 2 files changed +4
-10
lines changed
main/java/com/thealgorithms/sorts
test/java/com/thealgorithms/datastructures/heaps 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -13,12 +13,12 @@ public SmoothSort() {
13
13
private static <T extends Comparable <T >> void smoothSort (T [] array ) {
14
14
LeonardoHeap <T > leonardoHeap = new LeonardoHeap <T >();
15
15
16
- for (final var element : array ) {
16
+ for (final var element : array ) {
17
17
leonardoHeap .addElement (element );
18
18
}
19
19
20
20
for (int i = 0 ; i < array .length ; i ++) {
21
- array [array .length - i - 1 ] = leonardoHeap .removeElement ();;
21
+ array [array .length - i - 1 ] = leonardoHeap .removeElement ();
22
22
}
23
23
}
24
24
Original file line number Diff line number Diff line change 2
2
3
3
import static org .junit .jupiter .api .Assertions .assertEquals ;
4
4
5
- import java .util .ArrayList ;
6
- import java .util .List ;
7
- import java .util .Random ;
8
-
9
5
import org .junit .jupiter .api .Test ;
10
6
11
7
public class LeonardoHeapTest {
@@ -63,7 +59,7 @@ public void testAlwaysCurrentMaxElementIsRemoved() {
63
59
heap .addElement (8 );
64
60
heap .addElement (7 );
65
61
heap .addElement (3 );
66
-
62
+
67
63
heap .addElement (4 );
68
64
heap .addElement (4 );
69
65
heap .addElement (4 );
@@ -94,7 +90,7 @@ public void testForCompareChildAndSwap() {
94
90
heap .addElement (33 );
95
91
heap .addElement (40 );
96
92
heap .addElement (28 );
97
-
93
+
98
94
heap .addElement (95 );
99
95
heap .addElement (29 );
100
96
heap .addElement (88 );
@@ -121,6 +117,4 @@ public void testForCompareChildAndSwap() {
121
117
assertEquals (88 , heap .removeElement ());
122
118
assertEquals (84 , heap .removeElement ());
123
119
}
124
-
125
-
126
120
}
You can’t perform that action at this time.
0 commit comments