Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
41 lines (32 loc) · 767 Bytes

File metadata and controls

41 lines (32 loc) · 767 Bytes
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import org.junit.Test;
import solutions.Recursive;
public class TestRecursive {
@Test
public void testAllSubsetsRecursive() {
Set<Integer> s=new HashSet<Integer>();
s.add(0);
s.add(1);
s.add(2);
s.add(3);
s.add(4);
Set<Set<Integer>> sol = Recursive.allSubsetsRecursive(s);
if(sol != null){
System.out.println("{");
Iterator<Set<Integer>> solI=sol.iterator();
Iterator<Integer> csI;
while(solI.hasNext()){
System.out.print("{");
csI=solI.next().iterator();
while(csI.hasNext()){
System.out.print(csI.next().intValue());
System.out.print(" ");
}
System.out.println("}");
}
System.out.println("}");
}
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.