Part 14 of 15 in Binary Trees  

Create mirror image of a binary tree by animeshn

Problem statement

In this problem, you need to complete a function Node* getTreeMirror(Node*). This function accepts the root of a binary tree as its parameter. It should modify the tree, such that the resultant tree is the mirror image of the original tree. The mirror image of a binary tree is defined as another tree whose left and right children of all non-leaf nodes are interchanged.

If you give the correct mirror images of all trees you will receive a YES from us, else you will receive a NO.

To try out your code

Sign in

Sign up