Skip to content

Commit 118ef12

Browse files
committed
more options
1 parent 3459bca commit 118ef12

2 files changed

Lines changed: 4 additions & 12 deletions

File tree

‎src/components/Canvas/MainCanvas.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ class MainCanvas extends Component {
4343
this.selectionSort.setOptions = this.state.options;
4444
await this.Strategy.perform(options);
4545
}}>Selection Sort</button>
46-
4746
</div>
4847
{/* <Options className="col-span-2" options={this}/> */}
4948
</div>

‎src/components/Strategy/Algorithms/SelectionSort.js‎

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ export default class SelectionSort {
5252
if (currentNum < currentMinBar) {
5353
if (minBarIndex !== i) {
5454

55-
// Provide skyblue color to the (min-idx)th bar
55+
5656
unSortedBars[minBarIndex].style.backgroundColor = PROCESSING;
5757
}
5858
minBarIndex = j;
5959
unSortedBars[j].style.backgroundColor = CURRENT_MIN;
6060
} else {
6161

62-
// Provide skyblue color to the jth bar
62+
6363
unSortedBars[j].style.backgroundColor = PROCESSING;
6464
}
6565
}
@@ -70,17 +70,10 @@ export default class SelectionSort {
7070

7171

7272

73-
74-
// // Provide skyblue color to the (min-idx)th bar
75-
// array[minBarIndex].style.backgroundColor = DEFAULT;
76-
77-
// Provide lightgreen color to the ith bar
73+
7874
unSortedBars[i].style.backgroundColor = SORTAED;
7975

80-
// if(min !== i) { // SG 07/08/2022 12:09
81-
// [array[i], array[min]] = [array[min], array[i]];
82-
// this.Animation.swap(i, min, array);
83-
// }
76+
8477
}
8578
console.log(unSortedBars);
8679

0 commit comments

Comments
 (0)