[algogeeks] Re: LCA for a binary trees (not BST)

2011-08-24 Thread bugaboo
Just to add more details: Overall time complexity will be O(nlogn) If hash maps are used for step (3), then searching becomes O(1). The time xomplexity then reduces to O(n). On Aug 24, 10:15 am, bugaboo bharath.sri...@gmail.com wrote: Hey group, Just wondering what the hullabaloo is since I

Re: [algogeeks] Re: LCA for a binary trees (not BST)

2011-08-24 Thread Neha Singh
@bugaboo : you r storing the path in a string. Thats O(n) space which may not be an acceptable solution in many cases. If there is no space constraint, then ur solution is fine... -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this