Write a recursive method(Code ) static void mirrorTree(node root) This will take a tree as input and then change the tree such that it becomes a mirror of itself. We have the following methods implemented(you can use them and assume we coded somewhere else): getLeft(), getRight(), setLeft(), setRight(), getValue(). All the values in a node are integers. [Hint: Use them, and think how you would write when the tree only has 2 children ] Example:
Write a recursive method(Code ) static void mirrorTree(node root) This will take a tree as input and then change the tree such that it becomes a mirror of itself. We have the following methods implemented(you can use them and assume we coded somewhere else): getLeft(), getRight(), setLeft(), setRight(), getValue(). All the values in a node are integers. [Hint: Use them, and think how you would write when the tree only has 2 children ] Example:
Related questions
Question
Write a recursive method(Code )
static void mirrorTree(node root)
This will take a tree as input and then change the tree such that it becomes a mirror of itself.
We have the following methods implemented(you can use them and assume we coded somewhere else): getLeft(), getRight(), setLeft(), setRight(), getValue(). All the values in a node are integers. [Hint: Use them, and think how you would write when the tree only has 2 children ]
Example:
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 1 images