Given a Binary Tree, convert it into its mirror. What is a Binary Tree? ➤A binary tree is made of nodes, where each node contains a "left" reference, a "right" reference, and a data element. The topmost node in the tree is called the root . Every node (excluding a root ) in a tree is connected by a directed edge from exactly one other node. This node is called a parent. Input: ➤The task is to complete the method that takes one argument, root of Binary Tree and modifies the tree. Output: ➤The function should convert the tree to its mirror. Plus: Check whether the binary tree and mirror tree is same or not. FOLLOW ME ON :- INSTAGRAM :- https://www.instagram.com/akshay_methaniya_2809/ YOUTUBE :- https://www.youtube.com/channel/UCDbGAU0c_78ue2IXi6ibtYQ FACEBOOK :- https://www.facebook.com/akshay.methaniya
Comments
Post a Comment