Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

>> REGISTER NOW TO START POSTING

# Thread: All permutations of 2 coordinate int array

1. ## 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:
```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.

2. ## Re: All permutations of 2 coordinate int array

Do you have any specific questions?

What have you tried?

3. ## 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.