Code Not Working

public class Main {

public static void main(String args[]) {
    int arr[]={20,10,30,50,60,5,80,25};
        quickSort(arr,0,arr.length-1);
        for(int a:arr){
            System.out.print(a+" ");
        }


}

public static void quickSort(int[] arr,int l,int h){
   int mid=(l+h)/2;
   int pivot=arr[mid];
   int left=l;
   int right=h;

   while(left<=right){
        while(arr[left]<pivot){
            left++;
        }
        while(arr[right]>pivot){
            right--;
        }

        if(left<=right) {
            int temp = arr[left];
            arr[left] = arr[right];
            arr[right] = temp;
            left++;
            right--;
        }

   }
   
    quickSort(arr,l,right);
    quickSort(arr,left,h);
}

}

Hey @nishant7822badaya You have to add a base case for recursion at the start of function :
if (lo >= hi)
return;

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.