This seems to be when the array size is not a power of 2 on certain inputs. I am not sure what.
Settings: Array size = 100, sort = reversed
arrayv-mean-qsort-2022-04-13_23.07.19.mp4
It will hang at a random element until it throws an ArrayIndexOutOfBoundsException:
java .lang .ArrayIndexOutOfBoundsException : Index 32768 out of bounds for length 32768
at io .github .arrayv .sorts .exchange .MeanQuickSort .partition (MeanQuickSort .java :102 )
at io .github .arrayv .sorts .exchange .MeanQuickSort .partition (MeanQuickSort .java :129 )
at io .github .arrayv .sorts .exchange .MeanQuickSort .partition (MeanQuickSort .java :129 )
at io .github .arrayv .sorts .exchange .MeanQuickSort .partition (MeanQuickSort .java :129 )
at io .github .arrayv .sorts .exchange .MeanQuickSort .partition (MeanQuickSort .java :129 )
at io .github .arrayv .sorts .exchange .MeanQuickSort .partition (MeanQuickSort .java :129 )
at io .github .arrayv .sorts .exchange .MeanQuickSort .partition (MeanQuickSort .java :132 )
at io .github .arrayv .sorts .exchange .MeanQuickSort .partition (MeanQuickSort .java :129 )
at io .github .arrayv .sorts .exchange .MeanQuickSort .partition (MeanQuickSort .java :129 )
at io .github .arrayv .sorts .exchange .MeanQuickSort .partition (MeanQuickSort .java :129 )
at io .github .arrayv .sorts .exchange .MeanQuickSort .partition (MeanQuickSort .java :129 )
at io .github .arrayv .sorts .exchange .MeanQuickSort .runSort (MeanQuickSort .java :148 )
at io .github .arrayv .main .RunSort$1 .run (RunSort .java :217 )
The program ends up in an unusable state because clearAllMarks also goes out of bounds.
Exception in thread "ComparisonSorting" java .lang .ArrayIndexOutOfBoundsException : Index 32768 out of bounds for length 32768
at io .github .arrayv .utils .Highlights .clearAllMarks (Highlights .java :208 )
at io .github .arrayv .main .ArrayVisualizer .endSort (ArrayVisualizer .java :1289 )
at io .github .arrayv .main .RunSort$1 .run (RunSort .java :240 )
This seems to be when the array size is not a power of 2 on certain inputs. I am not sure what.
Settings: Array size = 100, sort = reversed
arrayv-mean-qsort-2022-04-13_23.07.19.mp4
It will hang at a random element until it throws an ArrayIndexOutOfBoundsException:
The program ends up in an unusable state because
clearAllMarksalso goes out of bounds.