nope, it will not work :(
got a case

On Mon, May 30, 2011 at 11:57 PM, sunny agrawal <sunny816.i...@gmail.com>wrote:

> won't this simple algo work ??
>
> start from root node, say it has value 0
> at any time if a node has a value v
> pass v-1 to left subtree and v+1 to right subtree
> keep track of max and min
> final answer will be max -min = Diameter of tree.
>
> correct me if i m wrong.
>



-- 
Sunny Aggrawal
B-Tech IV year,CSI
Indian Institute Of Technology,Roorkee

-- 
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