File tree Expand file tree Collapse file tree 1 file changed +30
-32
lines changed Expand file tree Collapse file tree 1 file changed +30
-32
lines changed Original file line number Diff line number Diff line change @@ -31,22 +31,19 @@ export default class SortingVisualizer extends React.Component {
31
31
}
32
32
33
33
bubbleSort = ( ) => {
34
- console . log ( "called bubble sort" )
35
34
removeButton ( ) ;
36
35
const animations = getBuubleSortAnimations ( this . state . array ) ;
37
36
performAnimation ( animations ) . then ( document . querySelector ( '#clear' ) . disabled = false )
38
37
39
38
}
40
39
41
40
selectionSort = ( ) => {
42
- console . log ( "called selection sort" )
43
41
removeButton ( ) ;
44
42
const animations = getSelectionSortAnimations ( this . state . array ) ;
45
43
performAnimation ( animations ) . then ( document . querySelector ( '#clear' ) . disabled = false )
46
44
}
47
45
48
46
insertionSort = ( ) => {
49
- console . log ( "called insertion sort" )
50
47
removeButton ( ) ;
51
48
const animations = getInsertionSortAnimations ( this . state . array ) ;
52
49
performAnimation ( animations ) . then ( document . querySelector ( '#clear' ) . disabled = false )
@@ -97,35 +94,36 @@ export default class SortingVisualizer extends React.Component {
97
94
< button id = "merge" className = "btn" onClick = { this . mergeSort } > Merge Sort</ button >
98
95
< button id = "clear" className = "btn" onClick = { this . clear } > Clear</ button >
99
96
< p >
100
- < h2 className = "complexity" > Time Complexity</ h2 >
101
-
102
- < table className = "tableDetails" >
103
- < tr >
104
- < th > Algorithm</ th >
105
- < th > Best Case</ th >
106
- < th > Worst Case</ th >
107
- </ tr >
108
- < tr >
109
- < td > Bubble Sort</ td >
110
- < td > O(n^2)</ td >
111
- < td > O(n^2)</ td >
112
- </ tr >
113
- < tr >
114
- < td > Selection Sort</ td >
115
- < td > O(n^2)</ td >
116
- < td > O(n^2)</ td >
117
- </ tr >
118
- < tr >
119
- < td > Insertion Sort</ td >
120
- < td > O(n^2)</ td >
121
- < td > O(n^2)</ td >
122
- </ tr >
123
- < tr >
124
- < td > Merge Sort</ td >
125
- < td > O(n log(n))</ td >
126
- < td > O(n log(n))</ td >
127
- </ tr >
128
- </ table >
97
+
98
+ < h2 className = "complexity" > Time Complexity</ h2 >
99
+ < table className = "tableDetails" >
100
+ < tr >
101
+ < th > Algorithm</ th >
102
+ < th > Best Case</ th >
103
+ < th > Worst Case</ th >
104
+ </ tr >
105
+ < tr >
106
+ < td > Bubble Sort</ td >
107
+ < td > O(n^2)</ td >
108
+ < td > O(n^2)</ td >
109
+ </ tr >
110
+ < tr >
111
+ < td > Selection Sort</ td >
112
+ < td > O(n^2)</ td >
113
+ < td > O(n^2)</ td >
114
+ </ tr >
115
+ < tr >
116
+ < td > Insertion Sort</ td >
117
+ < td > O(n^2)</ td >
118
+ < td > O(n^2)</ td >
119
+ </ tr >
120
+ < tr >
121
+ < td > Merge Sort</ td >
122
+ < td > O(n log(n))</ td >
123
+ < td > O(n log(n))</ td >
124
+ </ tr >
125
+ </ table >
126
+
129
127
</ p >
130
128
</ div >
131
129
</ div >
You can’t perform that action at this time.
0 commit comments