You are viewing a single comment's thread. Return to all comments →
In Python:
def countSort(arr): d = {} arr_mid = len(arr)/2 for index, a in enumerate(arr): k = int(a[0]) v = "-" if index < arr_mid else a[1] if k in d.keys(): d[k].append(v) else: d[k] = [v] r = "" for sk in sorted(d.keys()): r = " ".join([r, *d[sk]]) print(r.strip())
Seems like cookies are disabled on this browser, please enable them to open this website
The Full Counting Sort
You are viewing a single comment's thread. Return to all comments →
In Python: