Closed prakashn27 closed 4 years ago
that solution is not too good, the one below must work. Basic recursion qn in my opinion.
void reverse(Node root) {
if (root == null) return;
Node temp = root.Left;
root.Left = root.Right;
root.Right = temp;
reverse(root.Left);
reverse(root.Right);
}
where do we set the left and right tree after inversing??
Lol.. i forgot to add that.. I have edited it now..
we will close the issue when we implement the structure and add this code into it.
Possible solution of max Howel interview question? have to test it before integrating it. http://www.quora.com/What-is-the-algorithmic-approach-to-invert-a-given-binary-tree