Are there already any implementations in C (or c++) for generating all possible combinations of n elements in groups of p elements, but starting at a given combination and ending in another given one?
Something important is not to generate/store all possible combinations and then get the ones needed.
For example: If I want combinations of unsigned ints less than 10, with five numbers per combination, and I only want to see combinations numbered 50--54 (for some consistent numbering of combinations), I would call
combination(10, 5, 50, 54) which would return somenthing like
50 (0, 1, 5, 7, 8)
51 (0, 1, 5, 7, 9)
52 (0, 1, 5, 8, 9)
53 (0, 1, 6, 7, 8)
54 (0, 1, 6, 7, 9)