I am working on a school project that requires me to sort 50 sets of integers of n size for 10 values of n. I have the sorting methods all worked out but what I can't figure out is how to package these monster arrays in order to loop them through the sorts.
My original thought was an array of two-dimensional arrays. I'm trying to stay away from ArrayList because I don't want to deal with the headache of downcasting integers. So my question is, is there a way to do something like:
private array[] fullList; //this is where I would store my 2-dimensional arrays
private int[n][50] sets; //this is where I would have my 50 sets of n length
Thoughts?
Okay, since I can't figure out to put it in the comments, this is what I came up with:
public BenchmarkSorts(int[] sizes) {
for (int i=0; i < sizes.length; i++){
set = int[(sizes[i])][50]
for (int row=0; row < sizes[i]; j++)
for (int column=0; column < 50; column++)
set[row][column] = rdm.nextInt();
fullList.add(i, set);
}
I wish I could use the ArrayList sort but it is an Algorithm Design Class and I have to do it the hard way.
But, now it won't let me use sizes[i] in the second line to initate the value of the array set... any ideas?