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 theroot. 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.
➤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 theroot. 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.
➤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.
Nice Question
ReplyDelete