I've been tryin to figure out how to pick numbers from the 'choices array' and put then into the results array. Can any body help me. I was thinking of adding a for loop but not sure. The code i got so far is below.
import java.util.Random;
import java.util.ArrayList;
public class PermutationGenerator
{
public PermutationGenerator(int length)
{
generator = new Random();
this.length = length;
}
public int[] nextPermutation()
{
int[] result = new int[length];
ArrayList<Integer> choices = new ArrayList<Integer>();
for (int i = 0; i < length; i++)
{
choices.add(i + 1);
}
return result;
}
private Random generator;
private int length;
}