I am completely confused here

As i understand, a binary tree has a root, and unrooted binary tree, i could
not understand what it is and what is the relevance(are we alking about
forest here?)

Also, i finding LCA for a BST is extremly easy, but for Binary tree, need to
understand how is it done with an example, request someone to throw some
light




Best Regards
Ashish Goel
"Think positive and find fuel in failure"
+919985813081
+919966006652


On Wed, Jan 12, 2011 at 2:18 AM, saurabh gupta <sgup...@gmail.com> wrote:

> Based on various comments I think folks do not consider B in the path from
> A to C which leads to the LCA solution.
> @SVIX, one can implement the tree with a parent pointer in each node but
> that doesn't matter in the general case.
> What you are essentially saying is: consider the tree to be a directed
> graph with parent -> child link to be one way, if that were the case we
> cannot even
> reach from A to C so that is out of question that's why we consider it to
> be a both way link.
> Now given this one can always argue that B lies in the path from A to C!
> i.e. A->D->M->B->M->C
> so here we can, perhaps, define a shortest path from A to C and it has to
> go through LCA.
>
> @all
> guys, one request please use @XYZ in case you are referring to a particular
> post by the person XYZ unless it is a general comment.
> just to avoid confusion.
>
>
>
>
> On Tue, Jan 11, 2011 at 8:06 PM, juver++ <avpostni...@gmail.com> wrote:
>
>> The tree can be unrooted. Although, in any tree there is unique path from
>> one node to another. Not only from the parent to childs.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Man goes to doctor. Says he's depressed. Says life seems harsh and cruel.
> Says he feels all alone in a threatening world where what lies ahead is
> vague and uncertain. Doctor says "Treatment is simple. Great clown
> Pagliacci is in town tonight. Go and see him. That should pick you up." Man
> bursts into tears. Says "But, doctor...I am Pagliacci."
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to