One can convert a binary tree to its mirror image by traversing it in 1 point a) Inorder b) Preorder c) Postorder d) None of the above code example
Example: mirror a binary tree
//mirror a binary tree
void mirror(Node root){
Queue q=new LinkedList<>();
q.add(root);
while(!q.isEmpty()){
Node currnode=q.poll();
Node temp=currnode.left;
currnode.left=currnode.right;
currnode.right=temp;
if(currnode.left!=null){
q.add(currnode.left);
}
if(currnode.right!=null){
q.add(currnode.right);
}
}
}