You are viewing a single comment's thread. Return to all comments →
A more "Pythonic" (?) version of the printer might be:
def printOrdered(counts): values = [] for i in range(len(counts)): values += counts[i] * [i] print(*values) return values # optional: output sorted array
(probably less clear though!)
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 →
A more "Pythonic" (?) version of the printer might be:
(probably less clear though!)