Class Twiddle<T>

  • All Implemented Interfaces:
    Iterable<Set<T>>

    public class Twiddle<T>
    extends Object
    implements Iterable<Set<T>>
    Generates all combinations of M elements drawn without replacement from a set of N elements. This routine may be used in two ways:
    • To generate all combinations of M out of N objects;
    • To generate all sequences of 0's and 1's containing M 1's.