I have this program for generating subsets, I need to run it with input n=23. It has been running for the past 5 hours, is it normal???
Thank you!
Code:/*generate subsets */ int subsets(vector < bool > sub, int i) { if (i > n) { return 0; } else if (i == n) { for (int j = 0; j < n; j += 1) { cout << sub[j] << " "; } allSubsets.push_back(sub); cout << endl; return 1; } sub[i] = false; int a = subsets(sub, i + 1); sub[i] = true; int b = subsets(sub, i + 1); return a + b; }