Skip to content

Instantly share code, notes, and snippets.

@bkb181
Last active June 12, 2020 17:21
Show Gist options
  • Save bkb181/cde3da112ac9883a651e526387a53c9e to your computer and use it in GitHub Desktop.
Save bkb181/cde3da112ac9883a651e526387a53c9e to your computer and use it in GitHub Desktop.
void all_subset(vector<int>& A, vector<int>& subset, int index)
{
print(subset);
for (int i = index; i < A.size(); i++)
{
subset.push_back(A[i]);
all_subset(A, subset, i + 1);
subset.pop_back();
}
return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment