I need to use a recursive algorithm to find the power set of a given set i.e a set of all the subsets of a given set.
For example, if a set is {a,b,c}, the power set happens to be a set of {a},{b},{c},{a,b}{a,c},{b,c},{a,b,c}.
I know that such a thread existed earlier on this forum but the solutions were not very elaborate. There were a lot of codes. Can someone instead give me the algorithm instaed of the source code. It will be of great help to me . I am just beginning to learn recursive algorithms
Say, original set contains element a. Then all subsets are divided in 2 classes: ones containing a and ones not. Note that set of sets containing a may be obtaining by adding a to each of sets not containing a. And that's the recursion.
Bookmarks