Академический Документы
Профессиональный Документы
Культура Документы
Algorithm: Subsets of f1
g
FIRST SUBSET is .
NEXT SUBSET after Y:
Find the last element not in Y (working back from the end).
If there's no such element, then Y was the last subset.
this Remove from Y all elements after , and add to Y. Return
set.
::: n
Algorithm: -subsets of f1
g
FIRST SUBSET is f1
g.
NEXT SUBSET after = f 1
g, where 1
:
Find the
rst such that + 1 62
increase by 1, set
= for
, and return the new set
is which case = f ; + 1
g this fails if =
= , in
the last set.
k
::: n
::: k
::: yk
yi
yi
yj
j < i
::: n
k yk
::: n