What is problem of my code in my jdk work properly but in this compiler all test case are wrong

import java.util.*;
public class buildBST {
private class Node{
Node left;
Node right;
int data;
}
private Node root;
void constract(int ar[]){
this.root=constract(ar,0,ar.length);
}
private Node constract(int ar[],int low,int high) {
if(low>=high)
{
return null;
}
int mid=(low + high)/2;
Node nn=new Node();
nn.data=ar[mid];
nn.left=constract(ar,low,mid);
nn.right=constract(ar,mid+1,high);
return nn;
}
void preOrder() {
preOrder(this.root);
}
public void preOrder(Node node) {
if(node==null)
return;
System.out.print(node.data+" ");
preOrder(node.left);
preOrder(node.right);
}
static Scanner scn=new Scanner(System.in);
public static void main(String[] args) {
buildBST BST=new buildBST();
int t=scn.nextInt();
while(t!=0) {
int n=scn.nextInt();
int ar[]=new int[n];
for(int i=0;i<n;i++) {
ar[i]=scn.nextInt();
}
BST.constract(ar);
BST.preOrder();
t–;
}

   }

}

yes please resolve it