Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   find al subsets (http://www.go4expert.com/forums/find-al-subsets-t2274/)

 just programming 17Dec2006 19:23

find al subsets

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.

 shabbir 17Dec2006 21:36

Re: find al subsets

Try All possible combinations of a string and I think that can kick start on your prob

 just programming 17Dec2006 22:36

Re: find al subsets

i saw this thread.it is very interesting.i open this thread for more ideas.
thanks anyway

 Aztec 18Dec2006 05:46

Re: find al subsets

You can make use of next_permutations

 shabbir 18Dec2006 05:52

Re: find al subsets

Quote:
 Originally Posted by Aztec You can make use of next_permutations

 Aztec 18Dec2006 07:43

Re: find al subsets

Quote:
 Originally Posted by shabbir Probably the link is next_permutations
Ah, yes. Thanks for correction.

 just programming 18Dec2006 14:27

Re: find al subsets

thanks a lot guys

 All times are GMT +5.5. The time now is 12:46.