Im trying to code a bubblesort with arraylists, but struggling with the temp part, im not really sure how to move forward from this point.
public static void bubbleSort(ArrayList<Course> a) {
Course temp;
for (int b = 0; b < list.size(); b++) {
for(int i = 1; i < list.size() - b - 1; i++) {
if (a.get(i - 1).compareTo(a.get(i) > 0) {
temp = list.get(i);
list.set(i, list.get(i-1))
list.set((i-1), temp))
}
}
}
}