Skip to content

Commit 99fc8ab

Browse files
committed
fix: updates the description of counting sort
1 parent ff7a7dc commit 99fc8ab

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/algorithms/sort/counting-sort/src/counting-sort.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
/**
22
* Counting Sort
33
*
4-
* Compares each pair of adjacent items and swaps them if they are in the wrong order
5-
* Continues looping through the array until no more swaps are needed
6-
* Not appropriate for large unsorted data sets
4+
* Counts the occurrence of each element in the input array and uses that to create a sorted output array
75
*
86
* Best case performance: Ω(n + k) (always loops through the input array, count array, and output array)
97
* Average case performance: θ(n + k) (always loops through the input array, count array, and output array)

0 commit comments

Comments
 (0)