- 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