This question already has an answer here:
- Obtaining a powerset of a set in Java 25 answers
I need to find all the subsets of an array using java.For e.g. if we have a set {1,2,3} then i should get {},{1},{2},{3},{1,2},{2,3},{1.3},{1,2,3}
This question already has an answer here:
I need to find all the subsets of an array using java.For e.g. if we have a set {1,2,3} then i should get {},{1},{2},{3},{1,2},{2,3},{1.3},{1,2,3}
You can do this to avoid needing to recurse the solutions.