All permutations of 2 coordinate int array

I have a set of 2D arrays, structured as so: int[][] cage = new int[someLength][4]. Each array has a set column length of 4; the first two columns are all that concern us with this problem. They are used to define the row and height respectively of a point (e.g. 2,4).

What I need is to generate all possible permutations of the points using both row and column coordinates from the 2D array. I found a working method to generate all permutations for 1D array of ints here: http://stackoverflow.com/questions/2...tegers-in-java, under update 2 of the first answer.

Here is an example of a possible input and corresponding output desired:

Code :

In: (1,0)
(1,1)
Out:(1,0),(1,1)
(1,1),(1,0)

Ideally the result will be stored in a 2D array of ints. Thanks in advance.

Re: All permutations of 2 coordinate int array

Do you have any specific questions?

What have you tried?

Re: All permutations of 2 coordinate int array

Welcome to the forum! Please read this topic to learn how to post code in code or highlight tags and other useful info for new members.