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);

Slides:



Advertisements
Similar presentations
Complete Structure class Date {class Date { private :private : // private data and functions// private data and functions public :public : // public data.
Advertisements

Continuation of chapter 6…. Nested while loop A while loop used within another while loop is called nested while loop. Q. An illustration to generate.
For(int i = 1; i
void count_down (int count) { for(i=count; i>1; i--) printf(" %d\t", count); } printf("A%d\n", count); if(count>1) count_down(count-1); printf("B%d\n",
Functions Prototypes, parameter passing, return values, activation frams.
Chapter 7 Sorting Part II. 7.3 QUICK SORT Example left right pivot i j 5 > pivot and should go to the other side. 2 < pivot and should go to.
Review of Inheritance. 2 Several Levels of Inheritance Base Class B Derived class D Derived class D1.
Templated Functions. Overloading vs Templating  Overloaded functions allow multiple functions with the same name.
Probing Galactic Central Region of Normal Galaxies with Photometric Method August, 27, 2002 Student Yeong-jyi Lei Advisor Chi Yuan Chien-Chang Yen.
Galaxy Classification
Black Hole Fueling Image from ESO. Accretion to Supermassive Black Hole a: Ho, Filippenko & Sargent 1997a 10^6Mo 10^8 yr.
Tinaliah, S. Kom.. * * * * * * * * * * * * * * * * * #include using namespace std; void main () { for (int i = 1; i
Triana Elizabeth, S.Kom. #include using namespace std; void main () { for (int i = 1; i
What is a Galaxy? A galaxy is made of billions of stars, dust, and gas all held together by gravity.A galaxy is made of billions of stars, dust, and gas.
1 Powers of Two: Trace Ex. Print powers of 2 that are  2 N. Increment i from 0 to N. Double v each time. int i = 0; int v = 1; while (i
AST 101 The Realm of the Nebulae. Meet the Neighbors.
AY16 March 20, 2008 Galaxies. Galaxies A modern topic: 1920 Shapley-Curtis Debate Evidence against galaxies as external 1. Proper motion of M31 (van Maanen)
Ranjit S. Mann Exam 1 CSE-670 Day OF Week. Day OF Week int dayofweek (int year, int month, int day) { int a = (14 - month)/12; int y = year - a; int m.
Pointers Example Use int main() { int *x; int y; int z; y = 10; x = &y; y = 11; *x = 12; z = 15; x = &z; *x = 5; z = 8; printf(“%d %d %d\n”, *x, y, z);
Improved Performance Of Diesel Driven Permanent Magnet Synchronous Generator Using Battery Energy Storage System By JANE MARIA S Edited By Sarath S Nair.
Susan CartwrightOur Evolving Universe1 Other galaxies n Telescopic images of the night sky reveal many other galaxies l l What do they look like?   are.
Recursion Examples Fundamentals of CS Case 1: Code /* Recursion: Case 1 */ #include void count (int index); main () { count (0); getchar(); } void count.
Measurements Magnitudes –Apparent magnitude (m) –Absolute magnitude (M) Distance modulus formula m-M = log (d)d in pc m-M == distance as given by.
9.1 INTERSECTION OF TWO LINES To find the intersection of two lines L(1) and L(2) :  Write both equations in parametric form. L(1)= (x1,y1,z1) + t(a,b,c)
Supplemental Information for: METABOLISM OF RAMELTEON IN HUMAN LIVER MICROSOMES AND CORRELATION WITH THE EFFECT OF FLUVOXAMINE ON RAMELTEON PHARMACOKINETICS.
CS110 Programming Language I Lab 4: Control Statements I Computer Science Department Spring 2014.
30 patient drug sensitivity data Figure S1. Figure S2A Myeloid regulator enrichment in AML.
Section 3 CSE 444 Introduction to Databases. Announcements Project 1 was due yesterday (10/14/2009) Homework 1 was released, due 10/28/2009.
Gaby Pavia and Gaby Pages. Section 12-1 Bases: congruent polygons lying in parallel planes Altitude: segment joining the two base planes and perpendicular.
FOR LOOP WALK THROUGH public class NestedFor { public static void main(String [] args) { for (int i = 1; i
Fig. S1a. HPLC chromatogram of intracellular sugars and polyols ’ contents of Pseudomonas lurida NPRs3 grown at 4°C and 28°C.
Introduction to array: why use arrays ?. Motivational example Problem: Write a program that reads in and stores away 5 double numbers After reading in.
(hr) Cleaved Caspase-9 Caspase nM Paclitaxel MCF-7 Figure S1a.
Kami, et al. Supplementary Fig. S2A. Kami, et al. Supplementary Fig. S2B.
Computer Programming A simple example /* HelloWorld: A simple C program */ #include int main (void) { printf (“Hello world!\n”); return.
Print Row Function void PrintRow(float x[ ][4],int i) { int j; for(j=0;j
Dr. Yang, QingXiong (with slides borrowed from Dr. Yuen, Joe) LT:10 Advance Pointer Array, String and Dynamic Memory Allocation CS2311 Computer Programming.
© 2007 Lawrenceville Press Slide 1 Chapter 4 Review Assignment Statement An assignment statement gives a value to a variable. Assignment can take several.
Int fact (int n) { If (n == 0) return 1; else return n * fact (n – 1); } 5 void main () { Int Sum; : Sum = fact (5); : } Factorial Program Using Recursion.
Recursion occurs when a method calls itself. Google “recursion”
Constituent protein characteristics Constituent detected peptide characteristics Figure S1A.
Arrays Name, Index, Address. Arrays – Declaration and Initialization int x; y[0] y[1] y[2]
1 Intellectual Property Laws Amendment Bill – Parliamentary Legal Adviser’s Opinion Presentation to the Portfolio Committee on Trade and Industry – 1 June.
5.4 – Factor and Solve Polynomial Functions
S2 Fig. Phenotype of donor cells in the spleen and bone marrow of male mice. Splenocytes and bone marrow were isolated from male donor mice and stained.
Fig S8A - Activity of ligands LI and LII against C. albicans, C
Static vs Dynamic Scope
Galaxy Classification
mSCOA VENDOR REPORTING FORUM SCHEDULE SUBMISSIONS
Computing Adjusted Quiz Total Score
الصكوك : المبادئ الشرعية
M31: The Andromeda Galaxy
INC 161 , CPE 100 Computer Programming
Finite State Machines Experiment 4 Introduction
String class and its objects
Self study.
BETA = 0° SA axis oriented 90° off of S/C X-axis.
class PrintOnetoTen { public static void main(String args[]) {
CSE Module 1 A Programming Primer
CPSC-608 Database Systems
GALAXIES.
The Stack.
Galaxy Classification
2D Array TA.Rawan.
Library in c++ ( as cmath , iostream , …… etc.)
Supplementary Figure S3
3.5 Perform Basic Matrix Operations Algebra II.
Chapter 11 Classes.
Cumulative number of individuals that produced an first anal droplet
Tutorial - 1 Course: CS60045 Pallab Dasgupta Professor,
Presentation transcript:

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(); }

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(); }

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(); }

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(); }

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}

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}

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}

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}

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}

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}

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}

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}

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}

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}

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}

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}

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}

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}

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}

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}

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}