>>> l = [2,3,1,0,6,4,7,8,5,9]
    >>> quick_sorted(l)
    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
    >>> quick_sorted(l, func=lambda a, b: cmp(b, a))
    [9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
    >>> quick_sorted(l, reversed=True)
    [9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
    >>> quick_sorted(l, func=lambda a, b: cmp(b, a), reversed=True)
    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

def quick_sorted(lst, func=cmp, reversed=False):
    """
    >>> l = [2,3,1,0,6,4,7,8,5,9]
    >>> quick_sorted(l)
    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
    >>> quick_sorted(l, func=lambda a, b: cmp(b, a))
    [9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
    >>> quick_sorted(l, reversed=True)
    [9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
    >>> quick_sorted(l, func=lambda a, b: cmp(b, a), reversed=True)
    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
    """
    if len(lst) <= 1:
        return lst
    pivot = lst[0]
    before = []
    after = []
    for s in lst[1:]:
        res = func(s, pivot)
        if res > 0:
            after.append(s)
        else:
            before.append(s)
    before = quick_sorted(before, func=func)
    after = quick_sorted(after, func=func)
    if reversed:
        return (before + [pivot] + after)[::-1]
    else:
        return before + [pivot] + after