Skip to content

Commit 498e01c

Browse files
committed
Radix sort animation bugs fixed
1 parent e3a6200 commit 498e01c

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,10 @@ class RadixSortLSD {
5252
const valueInOldArray = array[sortedIndex];
5353

5454
Animation.swap(oldIndex, sortedIndex); // SG 07/10/2022 22:35 swap animation
55-
if(finalIteration) {
56-
DOM[oldIndex].style.backgroundColor = SORTED_COLOR;
55+
56+
if(finalIteration) { // SG 07/11/2022 00:29 Sorted array at the last iteration, coloring them sortedColor
5757
DOM[sortedIndex].style.backgroundColor = SORTED_COLOR;
5858
}
59-
// BUG empty elements in bucket are ccurrently olored green due to
60-
// TODO make sure that empty elemets in bucket are the default color
61-
// TODO grab those elements from DOM and change color back to defaut OR add a new condition in above if(finalIteration)
62-
6359
sortedArray[sortedIndex] = oldValue;
6460
bucket[Math.floor(array[i] / exp) % 100]--;
6561
}

0 commit comments

Comments
 (0)