Doubt regarding delete nodes from bst problem

This is my code . Can you tell me where did I go wrong ? All the test cases are failing .

import java.util.*;
public class Main {
public static void main(String args[]) {

	Scanner scan = new Scanner(System.in) ;
	int t = scan.nextInt() ;
	while(t-- > 0){
		int n = scan.nextInt() ;
		int[] arr = new int[n] ;
		for(int i = 0 ; i < n ; i ++){
			arr[i] = scan.nextInt() ;
		}
		Arrays.sort(arr) ;
		BST bst = new BST(arr) ;
		int m = scan.nextInt() ;
		int[] del = new int[m] ;
		for(int i = 0 ; i < m ; i ++){
			del[i] = scan.nextInt() ;
		}
		for(int i = 0 ; i < del.length ; i ++){
			bst.remove(del[i]) ;
		}
		bst.preOrder() ;
		System.out.println() ;
	}

}

}
class BST{
private class Node{
int data ;
Node left ;
Node right ;
}
Node root ;
BST(int[] arr){
root = construct(arr,0,arr.length-1) ;
}

private Node construct(int[] arr, int low , int high){

	if(low > high){
		return null ;
	}

	int mid = (low+high)/2 ;
	Node nn = new Node() ;
	nn.data = arr[mid] ;
	nn.left = construct(arr,low,mid-1) ;
	nn.right = construct(arr,mid+1,high) ;

	return nn ;

}

public void remove(int item){
	remove(root,null,item,"") ;
}

private void remove(Node root , Node parent , int item ,String child){

	if(root == null){
		return ;
	}

	if(item > root.data){
		remove(root.right,root,item,"right") ;
	}
	else if(item < root.data){
		remove(root.left,root,item,"left") ;
	}
	else{
		if(root.left == null && root.right == null){
			if(child.equals("right")){
				parent.right = null ;
			}
			else{
				parent.left = null ;
			}
		}

		else if(root.left == null && root.right != null){
			if(child.equals("right")){
				parent.right = root.right ;
			}
			else{
				parent.left = root.right ;
			}
		}

		else if(root.left != null && root.right == null){
			if(child.equals("right")){
				parent.right = root.left ;
			}
			else{
				parent.left = root.left ;
			}
		}

		else{
			int min = min(root.right) ;
			root.data = min ;
			remove(root.right,root,min,"right") ;
		}
	}		
}
private int min(Node root){

		if(root == null){
			return 0 ;
		}

		if(root.left == null){
			return root.data ;
		}

		return min(root.left) ;
}

public void preOrder(){
	preOrder(root) ;
}

private void preOrder(Node root){

	if(root == null){
		return ;
	}
	System.out.print(root.data+" ") ;
	preOrder(root.left) ;
	preOrder(root.right) ;
}

}

@Lalit2142 Hi buddy! You have constructed balanced binary tree so your tree is differing from the actual tree. You don’t have to sort the array.

For example :-
For test case: -
1
7
3 2 25 24 18 13 15
3
2 18 13

The root should be 3, 2 should be left of 3 then 25 at right of 3, 24 left of 25 and so on. but the way you are constructing tree your root is 15, so the tree is changed. So try to your build the tree this way.

Also check for case 10 30. If your doubt is cleared mark it resolved bro!