Skip to content

Commit 3f0b3dc

Browse files
authored
Update tortoise_and_hare.md
Center tags were not allowing rendering of images in mkdocs format
1 parent 862a10b commit 3f0b3dc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/others/tortoise_and_hare.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ tags:
77

88
Given a linked list where the starting point of that linked list is denoted by **head**, and there may or may not be a cycle present. For instance:
99

10-
<center>!["Linked list with cycle"](tortoise_hare_algo.png)</center>
10+
!["Linked list with cycle"](tortoise_hare_algo.png)
11+
1112

1213
Here we need to find out the point **C**, i.e the starting point of the cycle.
1314

@@ -27,7 +28,7 @@ So, it involved two steps:
2728
6. If they point to any same node at any point of their journey, it would indicate that the cycle indeed exists in the linked list.
2829
7. If we get null, it would indicate that the linked list has no cycle.
2930

30-
<center>!["Found cycle"](tortoise_hare_cycle_found.png)</center>
31+
!["Found cycle"](tortoise_hare_cycle_found.png)
3132

3233
Now, that we have figured out that there is a cycle present in the linked list, for the next step we need to find out the starting point of cycle, i.e., **C**.
3334
### Step 2: Starting point of the cycle
@@ -81,7 +82,7 @@ When the slow pointer has moved $k \cdot L$ steps, and the fast pointer has cove
8182

8283
Lets try to calculate the distance covered by both of the pointers till they point they met within the cycle.
8384

84-
<center>!["Proof"](tortoise_hare_proof.png)</center>
85+
!["Proof"](tortoise_hare_proof.png)
8586

8687
$slowDist = a + xL + b$ , $x\ge0$
8788

0 commit comments

Comments
 (0)