Re: [algogeeks] Re: determine if 2 BSTs will be identical or not based on input order of its keys

2013-07-14 Thread sourabh jain
You don't need to take vector for this you can have input in array also. You just need to check the elements in each partition . On 12-Jul-2013 8:27 PM, "Don" wrote: > Can anyone modify this solution so that it does not duplicate the memory > at each level of recursion? > > (Here is my solution w

[algogeeks] Re: Intrestting problem

2013-07-14 Thread kshitiz
pick '0' and keep track if we have visited that '0' before a '0' will not surrender if it is on boundary a '0' is ready to surrender if 1. it is surrounded by no '0' in all 4 directions (easy one) or 2. if it is surrounded by 1 to 4 '0' then it will surrender but we will ask each of the neighbo