Giving Memory Limit Exceeded


#1

For the given BST:
100
/
98 102
/
96 99

97

I give Input:
11 100 98 102 96 99 -1 -1 -1 97 -1 -1
97

But, It is giving error…


#2

Sorry, I got that.
Input should be
13 100 98 102 96 99 -1 -1 97 -1 -1 -1 -1 -1
--------- I forget to add -1, -1 for left and right child of 97
:slight_smile: