Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,25 @@
public static ArrayList<String> getpowerset(int a[],int n,ArrayList<String> ps)
{
if(n<0)
{
return null;
}
if(n==0)
{
if(ps==null)
ps=new ArrayList<String>();
ps.add(" ");
return ps;
}
ps=getpowerset(a, n-1, ps);
ArrayList<String> tmp=new ArrayList<String>();
for(String s:ps)
{
if(s.equals(" "))
tmp.add(""+a[n-1]);
else
tmp.add(s+a[n-1]);
}
ps.addAll(tmp);
return ps;
}