find al subsets

just programming's Avatar
Light Poster
hello to everybody.
i try to create an algorithm tha for any number [0,26] find all the subset of the alphabet.
for example if you give to the programm the number 4 the programm print out

{}
{a}
{b}
{a,b}
{c}
{a,c}
{b,c}
{a,b,c}
{d}
{a,d}
{b,d}
{a,b,d}
{c,d}
{a,c,d}
{b,c,d}
{a,b,c,d}

i have been thinking something.i would like to hear any ideas.
thanks for any reply
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Try All possible combinations of a string and I think that can kick start on your prob
just programming's Avatar
Light Poster
i saw this thread.it is very interesting.i open this thread for more ideas.
thanks anyway
Aztec's Avatar, Join Date: May 2006
Contributor
You can make use of next_permutations
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Quote:
Originally Posted by Aztec
You can make use of next_permutations
Probably the link is next_permutations
Aztec's Avatar, Join Date: May 2006
Contributor
Quote:
Originally Posted by shabbir
Probably the link is next_permutations
Ah, yes. Thanks for correction.
just programming's Avatar
Light Poster
thanks a lot guys