I'm currently practicing binary tree exercises on Leetcode and am often confused. I'm currently solving this
CodePudding user response:
When you do a level-ordered traversal of the tree, the array elements go in each open slot you encounter, so:
1
/ \
null 2
/ \
null 3
CodePudding user response:
The test case represents invalid input. In other words, you're right that it makes no sense. Leetcode wants to know how your program handles it.