Click here to see the full article post
The first algorithm will not work for [1, null, 2, 3, 4] as this algorithm will include 2 element in both left traversal as well as right traversal. Or I am missing something?
Pls check out my recursive solution. It does this in one iteration.
Please explain why the output of this test case:
is [1,2,3,5,6] not [1,2,3,5,6,4]?
 is not on the right boundary?
@tyuan73 root node doesn't have a right child, then according to the definition of right boundary only root node will be considered in right node. Hence 4 should not be there.
Small typo in "The current node is a root node: In this case, the right child will always be a left boundary node. e.g. relationship between A & C in the above figure."
It should say "The current node is a root node: In this case, the right child will always be a RIGHT boundary node. e.g. relationship between A & C in the above figure."
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.