Question 1064942: generate all the subsets of A={a,b,c,d,e,f,g,h,i}
Answer by Alan3354(69443) (Show Source):
You can put this solution on YOUR website! There are 512 of them.
Do it like this:
a b c d e f g h i
0 0 0 0 0 0 0 0 0 {}
0 0 0 0 0 0 0 0 1 {i}
0 0 0 0 0 0 0 1 0 {h}
0 0 0 0 0 0 0 1 1 {h,i}
.
.
.
1 1 1 1 1 1 1 1 1 {a,b,c,d,e,f,g,h,i}
Count in binary.
|
|
|