Obtaining combinations of k elements from n in C#

I needed an algorithm that could return all combinations of k number of elements within a finite set of n elements. Furthermore I wanted the algorithm to work in a non-recursive (iterative) way in C#. Step forward StackOverflow, specifically this answer given by Juan Antonio Cano I’ve taken his code and just made one or …

Continue reading ‘Obtaining combinations of k elements from n in C#’ »