-1

Possible Duplicate:
Algorithm to return all combinations of k elements from n

The combination can be formed with 3 digits from 1,2,3,4 such a way that d1 < d2 < d3 and so on.

Eg: 123,124,234 ...

n = 4 and k = 3

How do we do this ? Any clues as to how do we do this n choose k in java ?

Community
  • 1
  • 1
abracabra
  • 19
  • 4

1 Answers1

2

Ok, this must be homework so only hints.

  1. There has to be a lib somewhere in JAVA modeling combinatorics algorithms.

  2. If there isn't, you can always write one and use that. It's easy to do, get out Pascal's Triangle and get to work.

Jonathan Henson
  • 8,076
  • 3
  • 28
  • 52