i want to transfer an n elements array to a two-d array in java.
For example:
[1,2,3,4]
this array should be transferred to an two-d array
[[1, 2], [1, 3], [1, 4], [2, 3], [2, 4] [3,4]]
- the first line of the two-d array is 1, 2.
- the second line of the two- array is 1, 3.
- the third line of the two-array is 1, 4.
- the forth line of the two-array is 2, 3.
- the fifth line of the two-array is 2, 4.
- the last line is 3, 4
Algorithmon Paper. and then see how it works..