Skip to content

Commit e82762a

Browse files
Update TortoiseHareAlgo.java
Added {} after if statement instead of directly writing statement
1 parent 5d3ba75 commit e82762a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ public String toString() {
5252
Node<E> current = head;
5353
while (current != null) {
5454
sb.append(current.value);
55-
if (current.next != null) sb.append(", ");
55+
if (current.next != null) {
56+
sb.append(", ");
57+
}
5658
current = current.next;
5759
}
5860
sb.append("]");

0 commit comments

Comments
 (0)