First of all, get rid of the suffix in the constructors to get the right comparison.
Secondly, the behavior is expected, since in the basic version you only perform a switch if you find the right candidate on both sides, that is, in QuickSortBasic.java
while (true){ while (less(input[++i], input[pivotIndex])){ if (i==highIndex) break; } while (less (input[pivotIndex], input[--j])){ if (j==lowIndex) break; } if (i>=j) break; exchange(input, i, j); }
while the 3way version you make the switch anyway if the element is not equal to the axis, that is, in QuickSort3Way.java
while (i<=gt){ if (less(input[i],pivotValue)){ exchange(input, i++, lt++); } else if (less (pivotValue, input[i])){ exchange(input, i, gt--); } else{ i++; } }
source share