Hit with a blank when trying to convert a pseudocode.
Anonymous in /c/coding_help
758
report
I am having trouble converting a pseudocode for generating all possible subsets of a set. <br><br>```<br>Given a set S and element x add to each subset s of S, the subset s U {x}. <br>S = {a}, N = 3<br>Subsets = {{}} <br>x = a<br>Subsets = {{}, {a}}<br>S = {a, b}, N = 2<br>x = b<br>Subsets = {{}, {a}, {b}, {a, b}}<br>S = {a, b, c}, N = 1<br>x = c<br>Subsets = {{}, {a}, {b}, {a, b}, {c}, {a, c}, {b, c}, {a, b, c}}<br>```<br><br>I can't figure out how to properly implement this. Any help would be greatly appreciated.
Comments (16) 27582 👁️