// Binary Tree Structure class BinaryTreeNode {String data; BinaryTreeNode left; BinaryTreeNode right;}/*** enter a binary tree, output its image */public class BitreeMirrorImg {role = new role (System. in); // create a binary tree public BinaryTreeNode createTree (BinaryTreeNode root) {String data; data = metadata. next (); if (data. equals ("#") {return null;} root = new BinaryTreeNode (); root. data = data; root. left = createTree (root. left); root. right = cr EateTree (root. right); return root;} // obtain the binary tree image public void mirror (BinaryTreeNode root) {if (root = null) {return;} if (root. left = null) & (root. right = null) {return;} BinaryTreeNode temp = root. left; root. left = root. right; root. right = temp; mirror (root. left); mirror (root. right);} // layered traversal of the Binary Tree public void levelTraverse (BinaryTreeNode root) {java. util. repeated list <BinaryTreeNode> list = new java. util. revoke list <BinaryTreeNode> (); list. add (root); while (list. size ()! = 0) {BinaryTreeNode node = list. removeFirst (); System. out. print (node. data + ""); if (node. left! = Null) {list. add (node. left);} if (node. right! = Null) {list. add (node. right) ;}} public static void main (String [] args) {BitreeMirrorImg bmi = new BitreeMirrorImg (); BinaryTreeNode root = null; root = bmi. createTree (root); bmi. mirror (root); bmi. levelTraverse (root );}}