I have the next array:
[1, 401, None, 349, 90, None, None, 88, None, None, None, None, None, None, None]
I would like to build a tree where the 0 index is the root, the 1 index is the left child of the root, the 2 index is the right child of the root, and so on...
It will look like this:
349(3) 90(4) null(5) null(6)
I want to run a preorder depth-first search (DFS) on the root of a binary tree and return the root of the tree as a TreeNode type.
The excepted value I want is:
While I get:
Someone help, please?