File tree 2 files changed +6
-7
lines changed
main/java/com/thealgorithms/datastructures/lists
test/java/com/thealgorithms/datastructures/lists 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -43,8 +43,8 @@ public void insert(int value) {
43
43
}
44
44
newNode .next = temp .next ;
45
45
temp .next = newNode ;
46
- if (newNode .next == null ){
47
- this .tail = newNode ;
46
+ if (newNode .next == null ) {
47
+ this .tail = newNode ;
48
48
}
49
49
}
50
50
}
@@ -72,7 +72,7 @@ public boolean delete(int value) {
72
72
this .head = this .head .next ;
73
73
}
74
74
return true ;
75
- } else {
75
+ } else {
76
76
Node temp = this .head ;
77
77
while (temp .next != null ) {
78
78
if (temp .next .value == value ) {
@@ -146,7 +146,6 @@ public String toString() {
146
146
return "" ;
147
147
}
148
148
}
149
-
150
149
151
150
public class Node {
152
151
public int value ;
Original file line number Diff line number Diff line change @@ -64,20 +64,20 @@ public void testEmptyList() {
64
64
assertFalse (list .search (5 ));
65
65
}
66
66
@ Test
67
- public void testIsEmpty_onEmptyList () {
67
+ public void testIsEmptyOnEmptyList () {
68
68
SortedLinkedList list = new SortedLinkedList ();
69
69
assertTrue (list .isEmpty ());
70
70
}
71
71
72
72
@ Test
73
- public void testIsEmpty_onNonEmptyList () {
73
+ public void testIsEmptyOnNonEmptyList () {
74
74
SortedLinkedList list = new SortedLinkedList ();
75
75
list .insert (10 );
76
76
assertFalse (list .isEmpty ());
77
77
}
78
78
79
79
@ Test
80
- public void testIsEmpty_afterDeletion () {
80
+ public void testIsEmptyAfterDeletion () {
81
81
SortedLinkedList list = new SortedLinkedList ();
82
82
list .insert (10 );
83
83
list .delete (10 );
You can’t perform that action at this time.
0 commit comments