@ Shiv -
ur method will fail for
22
/ \
47 7
/
35
/\
17 45
\
90
here 17 35 45 90 shd be the tree
but in ur case as the first right is encountered (i.e. 45) the array
would reset and not consider 90.
--
You received this message because you are
in the gopinath solution we need to maintain another array and it
contains the maximum bst constructed so far...
when len is updated this array also updated to contain the present
queue values...
On Aug 15, 11:57 am, Ankit Singh ankitatit...@gmail.com wrote:
Space complexity- O(n), Time - O(n2).