Skip to content

Commit 3ba5bd1

Browse files
authored
Update counting_sort.py
1 parent c23335f commit 3ba5bd1

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

counting_sort.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
def counting_sort(arr):
2-
"""Couting_sort
3-
Sorting a array which has no element greater than k
4-
Creating a new temp_arr,where temp_arr[i] contain the number of
5-
element less than or equal to i in the arr
6-
Then placing the number i into a correct position in the result_arr
7-
return the result_arr
8-
Complexity: 0(n)
2+
"""
3+
Couting_sort
4+
Sorting a array which has no element greater than k
5+
Creating a new temp_arr,where temp_arr[i] contain the number of
6+
element less than or equal to i in the arr
7+
Then placing the number i into a correct position in the result_arr
8+
return the result_arr
9+
Complexity: 0(n)
910
"""
1011

1112
m = min(arr)

0 commit comments

Comments
 (0)