File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
src/components/DSA/arrays/BubbleSortVisualization Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 11import 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 */
1010const 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
You can’t perform that action at this time.
0 commit comments