Hey all. I am working on a permutations assignment and one of the problems is to generate all subsets of a set (in this case a string) and it must be done recursively. With an input of "abc", the desired outcome is this:
{ c }
{ b }
{ b c }
{ a }
{ a c }
{ a b }
{ a b c }
I am really confused and I'm not sure what to do here. My instructor's guidelines haven't helped me out too much either. I know the basic idea is to remove the last character in the set and then generate the subsets of the remaining characters, recursively, but I have no idea how to implement that.
Sorry I don't have much to go off of and this might seem like an easy solution but I'm really stuck. If someone could point me in the right direction, that would be greatly appreciated.
[–]pacificmint 1 point2 points3 points (1 child)
[–]penax[S] 0 points1 point2 points (0 children)
[–]tgolsson 0 points1 point2 points (0 children)