QuickSort with Many Elements causes StackOverflowError
问题 Good day! I am getting a StackOverflowError when running my quickSort algorithm. This error occurs when elements in the array > 50 000. My code is below : public void recQuickSort(int left, int right) { if(right-left <= 0) return; else { long pivot = a[right]; int partition = partitionIt(left, right, pivot); recQuickSort(left, partition-1); recQuickSort(partition+1, right); } } public int partitionIt(int left, int right, long pivot) { int leftPtr = left - 1; int rightPtr = right; while (true)