I want to generate all the subsets of size k from a set.
eg:-say I have a set of 6 elements, I have to list all the subsets in which the cardinality of elements is 3.
I tried looking for solution,but those are code snippets. Its been long since I have done coding,so I find it hard to understand the code and construct a executable program around it.
A complete executable program in C or C++ will be quite helpful. Hoping of an optimal solution using recursion.
See Question&Answers more detail:os