You are viewing a single comment's thread. Return to all comments →
Python
def countingSort(arr): if n >= 100 and n <= 10**6: # First constrain frecuency_array = [] for i in range(100): frecuency_array.append(arr.count(i)) if arr[i] < 0 or arr[i] >= 100: # Second constrain raise ValueError('Second constrain violated') else: raise ValueError('First constrain violated') return frecuency_array
Seems like cookies are disabled on this browser, please enable them to open this website
Counting Sort 1
You are viewing a single comment's thread. Return to all comments →
Python