You are viewing a single comment's thread. Return to all comments →
def countSort(arr): half_len = (len(arr) // 2) sorted_list = [[] for _ in range(half_len + 1)] for i, element in enumerate(arr): weight = int(element[0]) sorted_list[weight].append('-' if i < half_len else element[1]) print(' '.join([' '.join(sublist) for sublist in sorted_list]).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 →