I'm sure you probably get this a lot from CompSci students, I tried searching but mine looked a lot different from anything else I could find. Anyway, here is my class, it is supposed to sort an array of integers (then in the future be modified to sort objects, but ints will do for now).
My goal is to make an arrayList which is basically a row of buckets. then each bucket is a linked list. I feel like I'm on the right track, but the compiler doesn't like my last line of code, so I've run out of ideas.
here's an update. this is what I have now, but I still don't think it'll work
public void sorter(){
int highest_int = 0;
for(int i=0; i<entries.length; i++){
if (highest_int < entries[i])
highest_int = entries[i];
}
ArrayList<LinkedList<Integer>> row = new ArrayList<LinkedList<Integer>>();
LinkedList<Integer> column = new LinkedList<Integer>();
while (highest_int>0){
row.add(column);
highest_int--;
}
for(int i=0; i<entries.length; i++){
int j = entries[i];
column.add(0, j);
row.set(j, column);
}
}