Skip to content

Commit a706505

Browse files
authoredMar 16, 2023
Update CountingSort.test.js
1 parent 1ad60dc commit a706505

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎src/algorithms/sorting/counting-sort/__test__/CountingSort.test.js

+4
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,13 @@ describe('CountingSort', () => {
2727
const sorter = new CountingSort({ visitingCallback });
2828

2929
// Detect biggest number in array in prior.
30+
// Original array remains same
31+
3032
const biggestElement = Math.max(...notSortedArr);
3133

3234
// Detect smallest number in array in prior.
35+
// Original array remains same
36+
3337
const smallestElement = Math.min(...notSortedArr);
3438

3539
const sortedArray = sorter.sort(notSortedArr, smallestElement, biggestElement);

0 commit comments

Comments
 (0)
Please sign in to comment.