From 8169262dc3c564e2ffb347daf6e92cc0e37f320c Mon Sep 17 00:00:00 2001 From: Ajay Dhangar <99037494+ajay-dhangar@users.noreply.github.com> Date: Mon, 23 Sep 2024 09:06:40 +0530 Subject: [PATCH 1/2] Update index.tsx --- src/components/DSA/arrays/BubbleSortVisualization/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/DSA/arrays/BubbleSortVisualization/index.tsx b/src/components/DSA/arrays/BubbleSortVisualization/index.tsx index dcf82d4bf..c1a04f97b 100644 --- a/src/components/DSA/arrays/BubbleSortVisualization/index.tsx +++ b/src/components/DSA/arrays/BubbleSortVisualization/index.tsx @@ -83,7 +83,7 @@ const BubbleSortVisualization: React.FC = () => {

- Instructions: Click the "Sort" button to visualize the Bubble Sort algorithm. You can also adjust the speed of the visualization using the slider. + Instructions: Click the "Sort" button to visualize the Bubble Sort algorithm. You can also adjust the speed of the visualization using the slider.

{array.map((value, index) => ( From 246ffd70de96486b94f8b35782cea6f8f413f092 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Mon, 23 Sep 2024 03:37:10 +0000 Subject: [PATCH 2/2] Restyled by whitespace --- .../DSA/arrays/BubbleSortVisualization/index.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/DSA/arrays/BubbleSortVisualization/index.tsx b/src/components/DSA/arrays/BubbleSortVisualization/index.tsx index c1a04f97b..cdc72f11a 100644 --- a/src/components/DSA/arrays/BubbleSortVisualization/index.tsx +++ b/src/components/DSA/arrays/BubbleSortVisualization/index.tsx @@ -1,25 +1,25 @@ import React, { useState, useEffect } from 'react'; -import './BubbleSortVisualization.css'; +import './BubbleSortVisualization.css'; /** * BubbleSortVisualization Component * This component visualizes the Bubble Sort algorithm. - * + * * @returns {JSX.Element} The rendered component */ const BubbleSortVisualization: React.FC = () => { // State to store the array of numbers to be sorted const [array, setArray] = useState([]); // State to control the delay for visualization speed - const [delay, setDelay] = useState(200); + const [delay, setDelay] = useState(200); // State to indicate if sorting is in progress - const [isSorting, setIsSorting] = useState(false); + const [isSorting, setIsSorting] = useState(false); // State to store the indices of elements being compared const [comparingIndices, setComparingIndices] = useState([]); // Effect to generate a new array when the component mounts useEffect(() => { - generateArray(); + generateArray(); }, []); // Effect to update the CSS transition duration when the delay changes