Skip to content

Commit 1c2bb10

Browse files
committed
"Fixed whitespace and formatting issues in SortedLinkedList.java and SortedLinkedListTest.java"
1 parent 9e0cdf3 commit 1c2bb10

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/main/java/com/thealgorithms/datastructures/lists/SortedLinkedList.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ public void insert(int value) {
4343
}
4444
newNode.next = temp.next;
4545
temp.next = newNode;
46-
if (newNode.next==null){
47-
this.tail=newNode;
46+
if (newNode.next == null) {
47+
this.tail = newNode;
4848
}
4949
}
5050
}
@@ -72,7 +72,7 @@ public boolean delete(int value) {
7272
this.head = this.head.next;
7373
}
7474
return true;
75-
} else{
75+
} else {
7676
Node temp = this.head;
7777
while (temp.next != null) {
7878
if (temp.next.value == value) {
@@ -146,7 +146,6 @@ public String toString() {
146146
return "";
147147
}
148148
}
149-
150149

151150
public class Node {
152151
public int value;

src/test/java/com/thealgorithms/datastructures/lists/SortedLinkedListTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,20 @@ public void testEmptyList() {
6464
assertFalse(list.search(5));
6565
}
6666
@Test
67-
public void testIsEmpty_onEmptyList() {
67+
public void testIsEmptyOnEmptyList() {
6868
SortedLinkedList list = new SortedLinkedList();
6969
assertTrue(list.isEmpty());
7070
}
7171

7272
@Test
73-
public void testIsEmpty_onNonEmptyList() {
73+
public void testIsEmptyOnNonEmptyList() {
7474
SortedLinkedList list = new SortedLinkedList();
7575
list.insert(10);
7676
assertFalse(list.isEmpty());
7777
}
7878

7979
@Test
80-
public void testIsEmpty_afterDeletion() {
80+
public void testIsEmptyAfterDeletion() {
8181
SortedLinkedList list = new SortedLinkedList();
8282
list.insert(10);
8383
list.delete(10);

0 commit comments

Comments
 (0)