def accel_asc(n: int):
    """Efficient algorithm to generate all partitions of a positive integer

    Parameters
    ----------
    n : int
        a positive integer

    Yields
    ------
    list
        a partition of `n`
    """
    a = [(0) for i in range(n + 1)]
    k = 1
    y = n - 1
    while k != 0:
        x = a[k - 1] + 1
        k -= 1
        while 2 * x <= y:
            a[k] = x
            y -= x
            k += 1
        l = k + 1
        while x <= y:
            a[k] = x
            a[l] = y
            yield a[:k + 2]
            x += 1
            y -= 1
        a[k] = x + y
        y = x + y - 1
        yield a[:k + 1]
