class Solution {
public void mirror(TreeNode root) {
if(root==null) return ;
Queue<TreeNode> queue=new LinkedList<>();
queue.add(root);
while(!queue.isEmpty()){
int n=queue.size();
for(int i=0;i<n;i++){
TreeNode cur=queue.poll();
TreeNode temp=cur.left;
cur.left=cur.right;
cur.right=temp;
if(cur.left!=null) queue.add(cur.left);
if(cur.right!=null) queue.add(cur.right);
}
}
}
}