Why is 11 1 2 3 -1 -1 4 -1 -1 5 -1 -1 : 2 returning NULL


#1

Taking from the example, this:

     1
    / \ 
   2    3
      /
    4
     \
      5

should serialize as:
{1 2 3 -1 -1 4 -1 -1 5 -1 -1}

So I tried the expected output with:
11 1 2 3 -1 -1 4 -1 -1 5 -1 -1
2

Unless I’m misreading the problem, the answer should be 3, right, or at least the node containing 3. But the expect answer is saying NULL.


#2

Never mind. The example isn’t a BST…


#3

Actually,this is not a binary search tree, it is shown in example only for explaination that how u have to write ur input