This is showinf=g time limit error , but its running in O(N) time

public class Main {
public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
for(int i=1 ; i<=t ; i++){
int n=sc.nextInt();
int arr[]=new int[n];
for(int j=0 ; j<n ; j++){
arr[j]=sc.nextInt();
}

		BST tree=new BST(arr);
	//	tree.preOrder();
	}
}

}

class BST {

private class Node{
	int data;
	Node left=null;
	Node right=null;
}


private Node root;


public BST (int [] inorder) {
	this.root=construct(inorder , 0 , inorder.length-1);
}


private Node construct(int [] inorder , int start , int end) {

	if(start==end) {
		Node base = new Node();
		base.data=inorder[start];
		System.out.print(inorder[start]+" ");
		return base;
	}
	
	int mid=(start+end)/2;
	System.out.print(inorder[mid]+" ");
	
	Node node = new Node();
	
	node.data=inorder[mid];
	
	node.left=construct(inorder , start , mid-1);
	
	node.right=construct(inorder , mid+1 , end);
	
	return node;
	
}


public void preOrder(){
	this.preOrder(this.root);
}
private void preOrder(Node node){

	if(node==null) return;

	System.out.print(node.data+" ");

	preOrder(node.left);

	preOrder(node.right);

}

}

Hey @Himanshu-Jhawar-2273952536067590
add new line in each and every test Case
correct code

it is still showing run time error , even after adding new line

@Himanshu-Jhawar-2273952536067590
You can can see this code . some Extra changes

where is your code ?