Posts

Showing posts with the label mirror trees

How do mirror trees work?

Image
There are a few times in programming interviews when the problem statements are given only to test the knowledge of the candidates. One such common interview problem is the mirror binary tree problem.  So, now you might be wondering what mirror binary trees are, right! Well, a mirror tree can be defined as the exact replica of a regular binary tree with the positions of the left and the right subtrees interchanged. This is because the mirror binary tree is an exact reflection of the original binary tree as you would see through a mirror. Now, there are basically no uses of a mirror binary tree except for the fact that they are an exact copy of the regular binary tree. That is why, the problem statements related to mirror trees are often discussed in the interviews to test the coding skills of the candidates. In order to solve this problem, we usually implement the recursive algorithm. If you are interested in learning how, then keep reading the blog to know more about this approac...