Skip to content

Commit ee996ff

Browse files
authored
Merge pull request #4432 from CodeHarborHub/ajay-dhangar-patch-10
Update index.tsx
2 parents 99d1e25 + 424c077 commit ee996ff

File tree

1 file changed

+6
-6
lines changed
  • src/components/DSA/arrays/BubbleSortVisualization

1 file changed

+6
-6
lines changed

src/components/DSA/arrays/BubbleSortVisualization/index.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
import React, { useState, useEffect } from 'react';
2-
import './BubbleSortVisualization.css';
2+
import './BubbleSortVisualization.css';
33

44
/**
55
* BubbleSortVisualization Component
66
* This component visualizes the Bubble Sort algorithm.
7-
*
7+
*
88
* @returns {JSX.Element} The rendered component
99
*/
1010
const BubbleSortVisualization: React.FC = () => {
1111
// State to store the array of numbers to be sorted
1212
const [array, setArray] = useState<number[]>([]);
1313
// State to control the delay for visualization speed
14-
const [delay, setDelay] = useState<number>(200);
14+
const [delay, setDelay] = useState<number>(200);
1515
// State to indicate if sorting is in progress
16-
const [isSorting, setIsSorting] = useState<boolean>(false);
16+
const [isSorting, setIsSorting] = useState<boolean>(false);
1717
// State to store the indices of elements being compared
1818
const [comparingIndices, setComparingIndices] = useState<number[]>([]);
1919

2020
// Effect to generate a new array when the component mounts
2121
useEffect(() => {
22-
generateArray();
22+
generateArray();
2323
}, []);
2424

2525
// Effect to update the CSS transition duration when the delay changes
@@ -83,7 +83,7 @@ const BubbleSortVisualization: React.FC = () => {
8383
<button onClick={generateArray} disabled={isSorting}>Generate New Array</button>
8484
<br /><br />
8585
<p>
86-
<strong>Instructions:</strong> Click the "Sort" button to visualize the Bubble Sort algorithm. You can also adjust the speed of the visualization using the slider.
86+
<strong>Instructions:</strong> Click the &quot;Sort&quot; button to visualize the Bubble Sort algorithm. You can also adjust the speed of the visualization using the slider.
8787
</p>
8888
<div className="array-container">
8989
{array.map((value, index) => (

0 commit comments

Comments
 (0)