@Ravi: That is also my understanding, so the solution involves traversing
the tree and keeping track of the values of the two largest leaf nodes.
Dave
On Monday, August 27, 2012 12:53:05 PM UTC-5, Ravi Maggon wrote:
> @atul
> I think he is asking for max. sum of elements between 2 leaf nodes a
@Ankit: I haven't written code for this problem, but here is how I would do
it. You are given values of n and P, with n being up to a 500-digit number
(e.g., stored in an array, with say 9 digits of the number stored in each
of up to 112 (500/9 rounded up) integers and P fitting in one integer.
This problem is similar to one to all broadcast in parallel computing.
Imagine all the nodes in form of hypercube.
On Wed, Aug 22, 2012 at 2:04 PM, Karthikeyan V.B wrote:
> A network of N computers is such that each computer is connected to
> every other.Transferring one byte of information betw
keep a hash to check if digit is already used for that combination or not.
add this logic to existing combinations generator code.
On Sat, Aug 25, 2012 at 12:34 AM, amrit harry wrote:
> find the all possible combination of digits ranging 1 to 9 whose sum is
> 10,
> no digit shud be repeated in a
@atul
I think he is asking for max. sum of elements between 2 leaf nodes and not
the max distance between two nodes.
On Sun, Aug 26, 2012 at 6:12 PM, atul anand wrote:
> its the diameter of tree.
> you can find implementation on geeksforgeeks
>
> On 8/25/12, kunal rustgi wrote:
> > Hi,
> >
> >
@dave:
Can u Please elaborate your idea??
I didn't understand lucas theorem and in that theorem, i see too much
calculation and here we have to deal with testcases upto 100 and each
testcase containing n in range of 10500.
On Mon, Aug 27, 2012 at 4:02 AM, Dave wrote:
> @Ankit: Apply Lucas' The