RosetteCode offers source codes overs 40 programming languages.
how to a slightly shorter quick sort?
i found a simple article about quicksort in python and ruby. So, it was bestly compressed in whole part.
in python:
q=lambda s:s if len(s)<2 else q([x for x in s[1:]if x<s[0]])+[s[0]]+q([x for x in s[1:]if x>=s[0]])
Subscribe to:
Posts (Atom)