Write a function to mirror a binary tree (left node to right, right to left, etc). How about very unbalance tree?
Anonymous
This can be done with a recursive function that traverses the tree using post order depth traversal. Once the recursive calls to the left and right subtrees return, swap the left and right pointers. The base case would be when the pointer is null. The balance of the tree doesn't matter for this algorithm.
Check out your Company Bowl for anonymous work chats.