- All Implemented Interfaces:
IndexIterator
, java.io.Serializable
public class CombinationIterator
extends java.lang.Object
implements IndexIterator, java.io.Serializable
Iterator that returns different combinations of n integers taken k at a time.
For example, if constructed with n = 4 and k = 2, will return, in successive
calls to next(), the arrays {0,1},{0,2},{0,3},{1,2},{1,3},{2,3}. In this example
each array has k = 2 elements, selected from the n = 4 possible values {0,1,2,3}
with no duplication of elements in any individual iterate.
Entries in each array will be in numerical order.
- See Also:
- Serialized Form