Answer the question
In order to leave comments, you need to log in
How to implement iteration of random subsets?
Tell me how you can choose random subsets in an iterator, but with the condition of a guarantee of non-repeatability.
Those. so that when you receive the next subset, you do not have to check the fact of its previous use.
There are thoughts to use Gray codes - choose one of the code classes and generate binary numbers according to it.
UPD:
The task is to be able to enumerate ALL subsets of a given set (large enough). At the same time, get the next subset in the form:
class subsetSource<T>
{
public List<T> getNewSubset()
{
...
return ....
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question