this is my code and i am unable to submit it
import java.util.*;
public class Main
{
public static void main(String[] args)
{
Scanner in=new Scanner(System.in);
int n=in.nextInt();
int arr[]=new int[n];
for(int i=0;i<n;i++)
{
arr[i]=in.nextInt();
}
qs(arr,0,n-1);
}
public static void swap (int arr[], int x, int y)
{
int temp = arr[x];
arr[x] = arr[y];
arr[y] = temp;
}
public static void qs(int[] arr, int l, int h)
{
if (arr == null || arr.length == 0){
return;
}
if (l>= h){
return;
}
int mid = l + (h - l) / 2;
int pivot = arr[mid];
int i = l, j = h;
while (i <= j)
{
while (arr[i] < pivot)
{
i++;
}
while (arr[j] > pivot)
{
j--;
}
if (i <= j)
{
swap (arr, i, j);
i++;
j--;
}
}
if (l < j){
qs(arr, l, j);
}
if (h > i){
qs(arr, i, h);
}
if(l==0 && h==arr.length-1)
{
display(arr);
}
}
public static void display(int arr[])
{
for(int i=0;i<arr.length;i++)
{
System.out.print(arr[i]+" ");
}
}
}