Closed fuyb1992 closed 3 years ago
Hi @fuyb1992,
It should be [5,2,3,None,None,2,4,None,None,None,None,3,1]
.
Hi @joowani
[5,2,3,None,None,2,4,None,None,None,None,3,1]
works, but it is confused that None
node has child node.
Hi @fuyb1992,
it may seem unintuitive at first, but that's just how binary trees are represented in arrays. If there is a more succinct way, please let me know and I will consider adding it to the library. Thanks.
Tree:
Code:
Error:
FYI: