S
Savvoulidis Iordanis
Hi,
I'm looking for code that displays (or sets in an array) all the possible
combinations
(without concern of their order of appearence) of N numbers by K
that is, if we have N=5 numbers (1,2,3,4,5), the possible combinations of
every K=3 of them are:
1,2,3
1,2,4
1,2,5
1,3,4
1,3,5
1,4,5
2,3,4
2,3,5
2,4,5
3,4,5
The math formula for the count of combinations is : N! / ( K! * (N-K)! )
What I want though, is the actual combinations. Has anybody programmed this
kind of code?
I'm looking for code that displays (or sets in an array) all the possible
combinations
(without concern of their order of appearence) of N numbers by K
that is, if we have N=5 numbers (1,2,3,4,5), the possible combinations of
every K=3 of them are:
1,2,3
1,2,4
1,2,5
1,3,4
1,3,5
1,4,5
2,3,4
2,3,5
2,4,5
3,4,5
The math formula for the count of combinations is : N! / ( K! * (N-K)! )
What I want though, is the actual combinations. Has anybody programmed this
kind of code?