Download presentation
Presentation is loading. Please wait.
1
void main() { System.out.print("Enter n: "); int n = Integer.parseInt(scanner.nextLine()); for (int x = 0; x < n; x++) l.add(x); print(s); powerSet(0); } L:{ABCD} S:{} 1: x = 0 L:{ABCD} S:{A} 2: x = 1 L:{ABCD} S:{B} 10: x = 2 L:{ABCD} S:{C} 14: x = 3 L:{ABCD} S:{D} 16: x = 4 L:{ABCD} S:{CD} 15: x = 4 L:{ABCD} S:{BD} 13: x = 4 L:{ABCD} S:{BC} 11: x = 3 L:{ABCD} S:{BCD} 12: x = 4 L:{ABCD} S:{AD} 9: x = 4 L:{ABCD} S:{AC} 7: x = 3 L:{ABCD} S:{AB} 3: x = 2 L:{ABCD} S:{ACD} 8: x = 4 L:{ABCD} S:{ABC} 4: x = 3 L:{ABCD} S:{ABD} 6: x = 4 L:{ABCD} S:{ABCD} 5: x = 4 void powerSet(int x) { for (int i = x; i < L.size(); i++) { S.push(l.get(i)); print(S); powerSet(++x); S.pop(); }
2
void main() { System.out.print("Enter n: "); int n = Integer.parseInt(scanner.nextLine()); for (int x = 0; x < n; x++) l.add(x); print(s); powerSet(0); } L:{ABCD} S:{} 1: x = 0 L:{ABCD} S:{A} 2: x = 1 L:{ABCD} S:{B} 10: x = 2 L:{ABCD} S:{C} 14: x = 3 L:{ABCD} S:{D} 16: x = 4 L:{ABCD} S:{CD} 15: x = 4 L:{ABCD} S:{BD} 13: x = 4 L:{ABCD} S:{BC} 11: x = 3 L:{ABCD} S:{BCD} 12: x = 4 L:{ABCD} S:{AD} 9: x = 4 L:{ABCD} S:{AC} 7: x = 3 L:{ABCD} S:{AB} 3: x = 2 L:{ABCD} S:{ACD} 8: x = 4 L:{ABCD} S:{ABC} 4: x = 3 L:{ABCD} S:{ABD} 6: x = 4 L:{ABCD} S:{ABCD} 5: x = 4 void powerSet(int x) { for (int i = x; i < L.size(); i++) { S.push(l.get(i)); print(S); powerSet(++x); S.pop(); }
3
void main() { System.out.print("Enter n: "); int n = Integer.parseInt(scanner.nextLine()); for (int x = 0; x < n; x++) l.add(x); print(s); powerSet(0); } L:{ABCD} S:{} 1: x = 0 L:{ABCD} S:{A} 2: x = 1 L:{ABCD} S:{B} 10: x = 2 L:{ABCD} S:{C} 14: x = 3 L:{ABCD} S:{D} 16: x = 4 L:{ABCD} S:{CD} 15: x = 4 L:{ABCD} S:{BD} 13: x = 4 L:{ABCD} S:{BC} 11: x = 3 L:{ABCD} S:{BCD} 12: x = 4 L:{ABCD} S:{AD} 9: x = 4 L:{ABCD} S:{AC} 7: x = 3 L:{ABCD} S:{AB} 3: x = 2 L:{ABCD} S:{ACD} 8: x = 4 L:{ABCD} S:{ABC} 4: x = 3 L:{ABCD} S:{ABD} 6: x = 4 L:{ABCD} S:{ABCD} 5: x = 4 void powerSet(int x) { for (int i = x; i < L.size(); i++) { S.push(l.get(i)); print(S); powerSet(++x); S.pop(); }
4
void main() { System.out.print("Enter n: "); int n = Integer.parseInt(scanner.nextLine()); for (int x = 0; x < n; x++) l.add(x); print(s); powerSet(0); } L:{ABCD} S:{} 1: x = 0 L:{ABCD} S:{A} 2: x = 1 L:{ABCD} S:{B} 10: x = 2 L:{ABCD} S:{C} 14: x = 3 L:{ABCD} S:{D} 16: x = 4 L:{ABCD} S:{CD} 15: x = 4 L:{ABCD} S:{BD} 13: x = 4 L:{ABCD} S:{BC} 11: x = 3 L:{ABCD} S:{BCD} 12: x = 4 L:{ABCD} S:{AD} 9: x = 4 L:{ABCD} S:{AC} 7: x = 3 L:{ABCD} S:{AB} 3: x = 2 L:{ABCD} S:{ACD} 8: x = 4 L:{ABCD} S:{ABC} 4: x = 3 L:{ABCD} S:{ABD} 6: x = 4 L:{ABCD} S:{ABCD} 5: x = 4 void powerSet(int x) { for (int i = x; i < L.size(); i++) { S.push(l.get(i)); print(S); powerSet(++x); S.pop(); }
5
void main() { System.out.print("Enter n: "); int n = Integer.parseInt(scanner.nextLine()); for (int x = 0; x < n; x++) l.add(x); print(s); powerSet(0); } L:{ABCD} S:{} 1: x = 0 L:{ABCD} S:{A} 2: x = 1 L:{ABCD} S:{B} 10: x = 2 L:{ABCD} S:{C} 14: x = 3 L:{ABCD} S:{D} 16: x = 4 L:{ABCD} S:{CD} 15: x = 4 L:{ABCD} S:{BD} 13: x = 4 L:{ABCD} S:{BC} 11: x = 3 L:{ABCD} S:{BCD} 12: x = 4 L:{ABCD} S:{AD} 9: x = 4 L:{ABCD} S:{AC} 7: x = 3 L:{ABCD} S:{AB} 3: x = 2 L:{ABCD} S:{ACD} 8: x = 4 L:{ABCD} S:{ABC} 4: x = 3 L:{ABCD} S:{ABD} 6: x = 4 L:{ABCD} S:{ABCD} 5: x = 4 void powerSet(int x) { for (int i = x; i < L.size(); i++) { S.push(l.get(i)); print(S); powerSet(++x); S.pop(); } {A}
6
void main() { System.out.print("Enter n: "); int n = Integer.parseInt(scanner.nextLine()); for (int x = 0; x < n; x++) l.add(x); print(s); powerSet(0); } L:{ABCD} S:{} 1: x = 0 L:{ABCD} S:{A} 2: x = 1 L:{ABCD} S:{B} 10: x = 2 L:{ABCD} S:{C} 14: x = 3 L:{ABCD} S:{D} 16: x = 4 L:{ABCD} S:{CD} 15: x = 4 L:{ABCD} S:{BD} 13: x = 4 L:{ABCD} S:{BC} 11: x = 3 L:{ABCD} S:{BCD} 12: x = 4 L:{ABCD} S:{AD} 9: x = 4 L:{ABCD} S:{AC} 7: x = 3 L:{ABCD} S:{AB} 3: x = 2 L:{ABCD} S:{ACD} 8: x = 4 L:{ABCD} S:{ABC} 4: x = 3 L:{ABCD} S:{ABD} 6: x = 4 L:{ABCD} S:{ABCD} 5: x = 4 void powerSet(int x) { for (int i = x; i < L.size(); i++) { S.push(l.get(i)); print(S); powerSet(++x); S.pop(); } {A}
7
void main() { System.out.print("Enter n: "); int n = Integer.parseInt(scanner.nextLine()); for (int x = 0; x < n; x++) l.add(x); print(s); powerSet(0); } L:{ABCD} S:{} 1: x = 0 L:{ABCD} S:{A} 2: x = 1 L:{ABCD} S:{B} 10: x = 2 L:{ABCD} S:{C} 14: x = 3 L:{ABCD} S:{D} 16: x = 4 L:{ABCD} S:{CD} 15: x = 4 L:{ABCD} S:{BD} 13: x = 4 L:{ABCD} S:{BC} 11: x = 3 L:{ABCD} S:{BCD} 12: x = 4 L:{ABCD} S:{AD} 9: x = 4 L:{ABCD} S:{AC} 7: x = 3 L:{ABCD} S:{AB} 3: x = 2 L:{ABCD} S:{ACD} 8: x = 4 L:{ABCD} S:{ABC} 4: x = 3 L:{ABCD} S:{ABD} 6: x = 4 L:{ABCD} S:{ABCD} 5: x = 4 void powerSet(int x) { for (int i = x; i < L.size(); i++) { S.push(l.get(i)); print(S); powerSet(++x); S.pop(); } {A}
8
void main() { System.out.print("Enter n: "); int n = Integer.parseInt(scanner.nextLine()); for (int x = 0; x < n; x++) l.add(x); print(s); powerSet(0); } L:{ABCD} S:{} 1: x = 0 L:{ABCD} S:{A} 2: x = 1 L:{ABCD} S:{B} 10: x = 2 L:{ABCD} S:{C} 14: x = 3 L:{ABCD} S:{D} 16: x = 4 L:{ABCD} S:{CD} 15: x = 4 L:{ABCD} S:{BD} 13: x = 4 L:{ABCD} S:{BC} 11: x = 3 L:{ABCD} S:{BCD} 12: x = 4 L:{ABCD} S:{AD} 9: x = 4 L:{ABCD} S:{AC} 7: x = 3 L:{ABCD} S:{AB} 3: x = 2 L:{ABCD} S:{ACD} 8: x = 4 L:{ABCD} S:{ABC} 4: x = 3 L:{ABCD} S:{ABD} 6: x = 4 L:{ABCD} S:{ABCD} 5: x = 4 void powerSet(int x) { for (int i = x; i < L.size(); i++) { S.push(l.get(i)); print(S); powerSet(++x); S.pop(); } {A} {A, B}
9
void main() { System.out.print("Enter n: "); int n = Integer.parseInt(scanner.nextLine()); for (int x = 0; x < n; x++) l.add(x); print(s); powerSet(0); } L:{ABCD} S:{} 1: x = 0 L:{ABCD} S:{A} 2: x = 1 L:{ABCD} S:{B} 10: x = 2 L:{ABCD} S:{C} 14: x = 3 L:{ABCD} S:{D} 16: x = 4 L:{ABCD} S:{CD} 15: x = 4 L:{ABCD} S:{BD} 13: x = 4 L:{ABCD} S:{BC} 11: x = 3 L:{ABCD} S:{BCD} 12: x = 4 L:{ABCD} S:{AD} 9: x = 4 L:{ABCD} S:{AC} 7: x = 3 L:{ABCD} S:{AB} 3: x = 2 L:{ABCD} S:{ACD} 8: x = 4 L:{ABCD} S:{ABC} 4: x = 3 L:{ABCD} S:{ABD} 6: x = 4 L:{ABCD} S:{ABCD} 5: x = 4 void powerSet(int x) { for (int i = x; i < L.size(); i++) { S.push(l.get(i)); print(S); powerSet(++x); S.pop(); } {A} {A, B}
10
void main() { System.out.print("Enter n: "); int n = Integer.parseInt(scanner.nextLine()); for (int x = 0; x < n; x++) l.add(x); print(s); powerSet(0); } L:{ABCD} S:{} 1: x = 0 L:{ABCD} S:{A} 2: x = 1 L:{ABCD} S:{B} 10: x = 2 L:{ABCD} S:{C} 14: x = 3 L:{ABCD} S:{D} 16: x = 4 L:{ABCD} S:{CD} 15: x = 4 L:{ABCD} S:{BD} 13: x = 4 L:{ABCD} S:{BC} 11: x = 3 L:{ABCD} S:{BCD} 12: x = 4 L:{ABCD} S:{AD} 9: x = 4 L:{ABCD} S:{AC} 7: x = 3 L:{ABCD} S:{AB} 3: x = 2 L:{ABCD} S:{ACD} 8: x = 4 L:{ABCD} S:{ABC} 4: x = 3 L:{ABCD} S:{ABD} 6: x = 4 L:{ABCD} S:{ABCD} 5: x = 4 void powerSet(int x) { for (int i = x; i < L.size(); i++) { S.push(l.get(i)); print(S); powerSet(++x); S.pop(); } {A} {A, B}
11
void main() { System.out.print("Enter n: "); int n = Integer.parseInt(scanner.nextLine()); for (int x = 0; x < n; x++) l.add(x); print(s); powerSet(0); } L:{ABCD} S:{} 1: x = 0 L:{ABCD} S:{A} 2: x = 1 L:{ABCD} S:{B} 10: x = 2 L:{ABCD} S:{C} 14: x = 3 L:{ABCD} S:{D} 16: x = 4 L:{ABCD} S:{CD} 15: x = 4 L:{ABCD} S:{BD} 13: x = 4 L:{ABCD} S:{BC} 11: x = 3 L:{ABCD} S:{BCD} 12: x = 4 L:{ABCD} S:{AD} 9: x = 4 L:{ABCD} S:{AC} 7: x = 3 L:{ABCD} S:{AB} 3: x = 2 L:{ABCD} S:{ACD} 8: x = 4 L:{ABCD} S:{ABC} 4: x = 3 L:{ABCD} S:{ABD} 6: x = 4 L:{ABCD} S:{ABCD} 5: x = 4 void powerSet(int x) { for (int i = x; i < L.size(); i++) { S.push(l.get(i)); print(S); powerSet(++x); S.pop(); } {A} {A, B} {A, B, C}
12
void main() { System.out.print("Enter n: "); int n = Integer.parseInt(scanner.nextLine()); for (int x = 0; x < n; x++) l.add(x); print(s); powerSet(0); } L:{ABCD} S:{} 1: x = 0 L:{ABCD} S:{A} 2: x = 1 L:{ABCD} S:{B} 10: x = 2 L:{ABCD} S:{C} 14: x = 3 L:{ABCD} S:{D} 16: x = 4 L:{ABCD} S:{CD} 15: x = 4 L:{ABCD} S:{BD} 13: x = 4 L:{ABCD} S:{BC} 11: x = 3 L:{ABCD} S:{BCD} 12: x = 4 L:{ABCD} S:{AD} 9: x = 4 L:{ABCD} S:{AC} 7: x = 3 L:{ABCD} S:{AB} 3: x = 2 L:{ABCD} S:{ACD} 8: x = 4 L:{ABCD} S:{ABC} 4: x = 3 L:{ABCD} S:{ABD} 6: x = 4 L:{ABCD} S:{ABCD} 5: x = 4 void powerSet(int x) { for (int i = x; i < L.size(); i++) { S.push(l.get(i)); print(S); powerSet(++x); S.pop(); } {A} {A, B} {A, B, C}
13
void main() { System.out.print("Enter n: "); int n = Integer.parseInt(scanner.nextLine()); for (int x = 0; x < n; x++) l.add(x); print(s); powerSet(0); } L:{ABCD} S:{} 1: x = 0 L:{ABCD} S:{A} 2: x = 1 L:{ABCD} S:{B} 10: x = 2 L:{ABCD} S:{C} 14: x = 3 L:{ABCD} S:{D} 16: x = 4 L:{ABCD} S:{CD} 15: x = 4 L:{ABCD} S:{BD} 13: x = 4 L:{ABCD} S:{BC} 11: x = 3 L:{ABCD} S:{BCD} 12: x = 4 L:{ABCD} S:{AD} 9: x = 4 L:{ABCD} S:{AC} 7: x = 3 L:{ABCD} S:{AB} 3: x = 2 L:{ABCD} S:{ACD} 8: x = 4 L:{ABCD} S:{ABC} 4: x = 3 L:{ABCD} S:{ABD} 6: x = 4 L:{ABCD} S:{ABCD} 5: x = 4 void powerSet(int x) { for (int i = x; i < L.size(); i++) { S.push(l.get(i)); print(S); powerSet(++x); S.pop(); } {A} {A, B} {A, B, C}
14
void main() { System.out.print("Enter n: "); int n = Integer.parseInt(scanner.nextLine()); for (int x = 0; x < n; x++) l.add(x); print(s); powerSet(0); } L:{ABCD} S:{} 1: x = 0 L:{ABCD} S:{A} 2: x = 1 L:{ABCD} S:{B} 10: x = 2 L:{ABCD} S:{C} 14: x = 3 L:{ABCD} S:{D} 16: x = 4 L:{ABCD} S:{CD} 15: x = 4 L:{ABCD} S:{BD} 13: x = 4 L:{ABCD} S:{BC} 11: x = 3 L:{ABCD} S:{BCD} 12: x = 4 L:{ABCD} S:{AD} 9: x = 4 L:{ABCD} S:{AC} 7: x = 3 L:{ABCD} S:{AB} 3: x = 2 L:{ABCD} S:{ACD} 8: x = 4 L:{ABCD} S:{ABC} 4: x = 3 L:{ABCD} S:{ABD} 6: x = 4 L:{ABCD} S:{ABCD} 5: x = 4 void powerSet(int x) { for (int i = x; i < L.size(); i++) { S.push(l.get(i)); print(S); powerSet(++x); S.pop(); } {A} {A, B} {A, B, C} {A, B, C, D}
15
void main() { System.out.print("Enter n: "); int n = Integer.parseInt(scanner.nextLine()); for (int x = 0; x < n; x++) l.add(x); print(s); powerSet(0); } L:{ABCD} S:{} 1: x = 0 L:{ABCD} S:{A} 2: x = 1 L:{ABCD} S:{B} 10: x = 2 L:{ABCD} S:{C} 14: x = 3 L:{ABCD} S:{D} 16: x = 4 L:{ABCD} S:{CD} 15: x = 4 L:{ABCD} S:{BD} 13: x = 4 L:{ABCD} S:{BC} 11: x = 3 L:{ABCD} S:{BCD} 12: x = 4 L:{ABCD} S:{AD} 9: x = 4 L:{ABCD} S:{AC} 7: x = 3 L:{ABCD} S:{AB} 3: x = 2 L:{ABCD} S:{ACD} 8: x = 4 L:{ABCD} S:{ABC} 4: x = 3 L:{ABCD} S:{ABD} 6: x = 4 L:{ABCD} S:{ABCD} 5: x = 4 void powerSet(int x) { for (int i = x; i < L.size(); i++) { S.push(l.get(i)); print(S); powerSet(++x); S.pop(); } {A} {A, B} {A, B, C} {A, B, C, D}
16
void main() { System.out.print("Enter n: "); int n = Integer.parseInt(scanner.nextLine()); for (int x = 0; x < n; x++) l.add(x); print(s); powerSet(0); } L:{ABCD} S:{} 1: x = 0 L:{ABCD} S:{A} 2: x = 1 L:{ABCD} S:{B} 10: x = 2 L:{ABCD} S:{C} 14: x = 3 L:{ABCD} S:{D} 16: x = 4 L:{ABCD} S:{CD} 15: x = 4 L:{ABCD} S:{BD} 13: x = 4 L:{ABCD} S:{BC} 11: x = 3 L:{ABCD} S:{BCD} 12: x = 4 L:{ABCD} S:{AD} 9: x = 4 L:{ABCD} S:{AC} 7: x = 3 L:{ABCD} S:{AB} 3: x = 2 L:{ABCD} S:{ACD} 8: x = 4 L:{ABCD} S:{ABC} 4: x = 3 L:{ABCD} S:{ABD} 6: x = 4 L:{ABCD} S:{ABCD} 5: x = 4 void powerSet(int x) { for (int i = x; i < L.size(); i++) { S.push(l.get(i)); print(S); powerSet(++x); S.pop(); } {A} {A, B} {A, B, C} {A, B, C, D}
17
void main() { System.out.print("Enter n: "); int n = Integer.parseInt(scanner.nextLine()); for (int x = 0; x < n; x++) l.add(x); print(s); powerSet(0); } L:{ABCD} S:{} 1: x = 0 L:{ABCD} S:{A} 2: x = 1 L:{ABCD} S:{B} 10: x = 2 L:{ABCD} S:{C} 14: x = 3 L:{ABCD} S:{D} 16: x = 4 L:{ABCD} S:{CD} 15: x = 4 L:{ABCD} S:{BD} 13: x = 4 L:{ABCD} S:{BC} 11: x = 3 L:{ABCD} S:{BCD} 12: x = 4 L:{ABCD} S:{AD} 9: x = 4 L:{ABCD} S:{AC} 7: x = 3 L:{ABCD} S:{AB} 3: x = 2 L:{ABCD} S:{ACD} 8: x = 4 L:{ABCD} S:{ABC} 4: x = 3 L:{ABCD} S:{ABD} 6: x = 4 L:{ABCD} S:{ABCD} 5: x = 4 void powerSet(int x) { for (int i = x; i < L.size(); i++) { S.push(l.get(i)); print(S); powerSet(++x); S.pop(); } {A} {A, B} {A, B, C} {A, B, C, D}
18
void main() { System.out.print("Enter n: "); int n = Integer.parseInt(scanner.nextLine()); for (int x = 0; x < n; x++) l.add(x); print(s); powerSet(0); } L:{ABCD} S:{} 1: x = 0 L:{ABCD} S:{A} 2: x = 1 L:{ABCD} S:{B} 10: x = 2 L:{ABCD} S:{C} 14: x = 3 L:{ABCD} S:{D} 16: x = 4 L:{ABCD} S:{CD} 15: x = 4 L:{ABCD} S:{BD} 13: x = 4 L:{ABCD} S:{BC} 11: x = 3 L:{ABCD} S:{BCD} 12: x = 4 L:{ABCD} S:{AD} 9: x = 4 L:{ABCD} S:{AC} 7: x = 3 L:{ABCD} S:{AB} 3: x = 2 L:{ABCD} S:{ACD} 8: x = 4 L:{ABCD} S:{ABC} 4: x = 3 L:{ABCD} S:{ABD} 6: x = 4 L:{ABCD} S:{ABCD} 5: x = 4 void powerSet(int x) { for (int i = x; i < L.size(); i++) { S.push(l.get(i)); print(S); powerSet(++x); S.pop(); } {A} {A, B} {A, B, C} {A, B, C, D}
19
void main() { System.out.print("Enter n: "); int n = Integer.parseInt(scanner.nextLine()); for (int x = 0; x < n; x++) l.add(x); print(s); powerSet(0); } L:{ABCD} S:{} 1: x = 0 L:{ABCD} S:{A} 2: x = 1 L:{ABCD} S:{B} 10: x = 2 L:{ABCD} S:{C} 14: x = 3 L:{ABCD} S:{D} 16: x = 4 L:{ABCD} S:{CD} 15: x = 4 L:{ABCD} S:{BD} 13: x = 4 L:{ABCD} S:{BC} 11: x = 3 L:{ABCD} S:{BCD} 12: x = 4 L:{ABCD} S:{AD} 9: x = 4 L:{ABCD} S:{AC} 7: x = 3 L:{ABCD} S:{AB} 3: x = 2 L:{ABCD} S:{ACD} 8: x = 4 L:{ABCD} S:{ABC} 4: x = 3 L:{ABCD} S:{ABD} 6: x = 4 L:{ABCD} S:{ABCD} 5: x = 4 void powerSet(int x) { for (int i = x; i < L.size(); i++) { S.push(l.get(i)); print(S); powerSet(++x); S.pop(); } {A} {A, B} {A, B, C} {A, B, C, D} {A, B, D}
20
void main() { System.out.print("Enter n: "); int n = Integer.parseInt(scanner.nextLine()); for (int x = 0; x < n; x++) l.add(x); print(s); powerSet(0); } L:{ABCD} S:{} 1: x = 0 L:{ABCD} S:{A} 2: x = 1 L:{ABCD} S:{B} 10: x = 2 L:{ABCD} S:{C} 14: x = 3 L:{ABCD} S:{D} 16: x = 4 L:{ABCD} S:{CD} 15: x = 4 L:{ABCD} S:{BD} 13: x = 4 L:{ABCD} S:{BC} 11: x = 3 L:{ABCD} S:{BCD} 12: x = 4 L:{ABCD} S:{AD} 9: x = 4 L:{ABCD} S:{AC} 7: x = 3 L:{ABCD} S:{AB} 3: x = 2 L:{ABCD} S:{ACD} 8: x = 4 L:{ABCD} S:{ABC} 4: x = 3 L:{ABCD} S:{ABD} 6: x = 4 L:{ABCD} S:{ABCD} 5: x = 4 void powerSet(int x) { for (int i = x; i < L.size(); i++) { S.push(l.get(i)); print(S); powerSet(++x); S.pop(); } {A} {A, B} {A, B, C} {A, B, C, D} {A, B, D}
21
void main() { System.out.print("Enter n: "); int n = Integer.parseInt(scanner.nextLine()); for (int x = 0; x < n; x++) l.add(x); print(s); powerSet(0); } L:{ABCD} S:{} 1: x = 0 L:{ABCD} S:{A} 2: x = 1 L:{ABCD} S:{B} 10: x = 2 L:{ABCD} S:{C} 14: x = 3 L:{ABCD} S:{D} 16: x = 4 L:{ABCD} S:{CD} 15: x = 4 L:{ABCD} S:{BD} 13: x = 4 L:{ABCD} S:{BC} 11: x = 3 L:{ABCD} S:{BCD} 12: x = 4 L:{ABCD} S:{AD} 9: x = 4 L:{ABCD} S:{AC} 7: x = 3 L:{ABCD} S:{AB} 3: x = 2 L:{ABCD} S:{ACD} 8: x = 4 L:{ABCD} S:{ABC} 4: x = 3 L:{ABCD} S:{ABD} 6: x = 4 L:{ABCD} S:{ABCD} 5: x = 4 void powerSet(int x) { for (int i = x; i < L.size(); i++) { S.push(l.get(i)); print(S); powerSet(++x); S.pop(); } {A} {A, B} {A, B, C} {A, B, C, D} {A, B, D}
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.