I keep getting an IndexOutOfBounds error for the if statement down below and I don't know why. low is initially 0, high is set to 24, and the size of the ArrayList is 25.
for(int i = low + 1; low <= high; i++){
if(list.get(i).compareTo(list.get(pivIndex)) < 0){ //this line
E temp = list.get(pivIndex);
list.remove(pivIndex);
list.add(pivIndex, list.get(i));
list.remove(i);
list.add(i, temp);
}
}