chLLENGES RECURSION ( QUICKSORT )

sir plz mention the test case that is getting failed …my code is

package chall_Recursion;

import java.util.Scanner;

public class quicksort {
static Scanner s=new Scanner(System.in);
public static void main(String[] args) {
int len=s.nextInt();
if(len >=1 && len <= (int)(2 * Math.pow(10 ,5))) {
int[] arr=new int[len];
for(int i=0;i<len ;i++) {
arr[i] =s.nextInt();
}

quicksort(arr,0,len-1);
for(int i=0 ;i <len ;i++) {
System.out.print(arr[i] +" ");
}
}
}
 public static void quicksort(int[] arr ,int low ,int high) {
	 if(low >= high) {
		 return ;
	 }
	 int left = low;
	 int right = high;
	 int mid=(left + right)/2 ;
	
	 while(left < right) {
	 while(arr[left] < arr[mid]) {
		 left++ ;
	 }
	 while(arr[right] > arr[mid]) {
		 right-- ;
	 }
	 if(left <= right) {
	 int temp = arr[left];
	 arr[left] =arr[right];
	 arr[right] = temp ;
	 left++;
	 right-- ;
	 }
	 }
	 quicksort(arr ,low,right);
	quicksort(arr,left ,high);
	 }
 }

@sameeksha,
https://ide.codingblocks.com/s/265150 corrected code.

Store arr[mid] in a variable. Don’t access it everytime.

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.