Can't quick sort become stable sort?
问题 Approach 1 C.A.R Hoare introduced partitioning logic(shown below), which is taught in school, low = pivot = 0; i = 1; j = high = listSize-1; while (true) { while (a[i] <= a[pivot] && (i < high)) { i = i + 1; } while (a[j] >= a[pivot] && (j > low)) { j = j - 1; } if (i >= j) break; swap(a[i], a[j]) } swap(a[j], a[pivot]); // pivot element is positioned(once) return j; Approach 2 To basically try make it stable sort , Instead j pointing to last index( listSize-1 ), if j points to listSize/2 (i