Skip to content

Commit a90f534

Browse files
Update TortoiseHareAlgo.java
Added {} after if statement instead of directly writing statement
1 parent 9df52d5 commit a90f534

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
@@ -31,7 +31,9 @@ public void append(E value) {
3131
}
3232

3333
public E getMiddle() {
34-
if (head == null) return null;
34+
if (head == null){
35+
return null;
36+
}
3537

3638
Node<E> slow = head;
3739
Node<E> fast = head;

0 commit comments

Comments
 (0)