generate all subsets of size k from a set
- by Kumar
hi,
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.
Thanks in advance.
Kumar.