[algogeeks] Re: Directi question-centre of the tree

2010-10-03 Thread abhiram_n
I don't understand what you mean when you say minimum among all the nodes in the graph. In any case, your definition of centre of tree looks similar to the closeness centrality measure - http://www.faculty.ucr.edu/~hanneman/nettext/C10_Centrality.html#Closeness I doubt you can do it in O(N)...

[algogeeks] Re: Multiplication of two numbers

2010-09-20 Thread abhiram_n
Wonder if this works: x = A / 10^(a-1) // take it as a decimal value itself y = B / 10^(b-1) // take it as a decimal value itself if x * y = 10.0 return (a+b) else return (a+b-1) One advantage of the above method is that it can be done mentally. On Sep 20, 10:47 am, Dave