The answer is both yes and no. It is a hole, and you would need to connect 5 to 6, but the situation will not occur in this problem. It will, however, occur in Populating Next Right Pointers II.
hi @mike3, please looked at the related question shown in my question. You showed me that the actual tree shape in that question, and it seems like there is a # in the middle of the tree..
And it occurred in this problem, not its sequel? If it is, that's very strange. Still, you do need to connect them, even if there are holes.
It is very strange that I didn't connect 5 and 6 but the answer is accepted... I have no idea why...
I've changed the original question's answer. I was using the normal tree serialization. This problem has a slight change in the process. The new tree lacks the holes.
Now I understand it. Thank you so much @mike3 for your patience in answering my questions!
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.