You are viewing a single comment's thread. Return to all comments →
My Python3 solution:
def countingSort(arr): idx_arr=(max(arr)+1)*[0] sorted_arr=[] for i in arr: idx_arr[i]+=1 for i in range(len(idx_arr)): sorted_arr=sorted_arr + idx_arr[i]*[i] return sorted_arr
Seems like cookies are disabled on this browser, please enable them to open this website
Counting Sort 2
You are viewing a single comment's thread. Return to all comments →
My Python3 solution: