Last active
June 12, 2020 16:58
-
-
Save bkb181/aef13098af048b7170e3c6b3a5d4e31a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void all_subset(vector<int> a) | |
{ | |
int n=a.size(), c=0, i; | |
int total = pow(2, n); | |
for(c= 0; c< total; c++) | |
{ | |
for(i= 0; i< n; i++) | |
{ | |
if(c&(1<< i)) | |
cout << a[i]; | |
} | |
cout << endl; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment