randomized quick sort in Java need a suble fix?
问题 I have implemented the quicksort algorithm that uses the first element of the list as pivot and it worked fine. now I refactored to pick a random index as pivot element, swap with the first element and do the quicksort subroutine. somehow, it does not work, I do not get the sorted array. here is my code, which is self-explanatory, but I am happy to explain if any clarification needed. public class Qsort { public static void quickSort2(int[] arr, int i, int j){ if (i<j){ int part