[algogeeks] Re: n balls and k different colors 1=k=n

2009-10-10 Thread vicky
i didn't get anything plz elaborate On Oct 10, 10:44 am, Prunthaban Kanthakumar pruntha...@gmail.com wrote: Sterling numbers of second kind. On Sat, Oct 10, 2009 at 10:41 AM, vicky mehta...@gmail.com wrote: example: n=10,k=10 ans:1 n=30,k=7 ans: 475020 On Oct 10, 9:51 am,

[algogeeks] Re: n balls and k different colors 1=k=n

2009-10-10 Thread Prunthaban Kanthakumar
I just noticed that in your problem the balls are 'similar'. Then the solution is a simple composition and the answer is {n-1, k-1} where {n,k} stands for binomial coefficient. I will give a proof sometime later if needed. On Sat, Oct 10, 2009 at 11:22 AM, vicky mehta...@gmail.com wrote: i

[algogeeks] Re: Y shaped linklist

2009-10-10 Thread Manisha
@sandeep notice that solution given on the given link doesn't satisfy the conditions given in the above question. @sharad Both lists may have duplicate values. So in this case it will better to hash the address of node instead of values. One other way is to maintain a flag in each of the node.

[algogeeks] Interesting array multiplication problem

2009-10-10 Thread Manisha
There is an array A[N] of N numbers. You have to compose an array Output[N] such that Output[i] will be equal to multiplication of all the elements of A[N] except A[i]. For example Output[0] will be multiplication of A[1] to A[N-1] and Output[1] will be multiplication of A[0] and from A[2] to

[algogeeks] Find the Grid row containing all 1's except intersection point in constant time

2009-10-10 Thread Manisha
There is a n x n grid of 1's and 0's. Find the i, where i is the row containing all 1's, except the intersection point. Should do it in less than 25 comparisons? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[algogeeks] Re: n balls and k different colors 1=k=n

2009-10-10 Thread nikhil garg
a very simple proof of the formula is using generating function for counting On Sat, Oct 10, 2009 at 3:08 PM, Prunthaban Kanthakumar pruntha...@gmail.com wrote: I just noticed that in your problem the balls are 'similar'. Then the solution is a simple composition and the answer is {n-1, k-1}

[algogeeks] Re: Find the Grid row containing all 1's except intersection point in constant time

2009-10-10 Thread Ramaswamy R
Whats with the intersection point? Intersection of what two things are we talking about here? Row of 1s and column of 1s? On Sat, Oct 10, 2009 at 3:47 AM, Manisha pgo...@gmail.com wrote: There is a n x n grid of 1's and 0's. Find the i, where i is the row containing all 1's, except the

[algogeeks] Re: Interesting array multiplication problem

2009-10-10 Thread anilkumarmyla
Nice solution Ramaswamy... --~--~-~--~~~---~--~~ 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] Re: Y shaped linklist

2009-10-10 Thread Manisha
One other way will be using two pointers. step1) Take two pointers(p1 and p2 ), pointing to the beginning of list L1 and L2. step2) Now start moving both the pointers simultaneously and check whether they point to same node. If not, then move both pointers to next node. Step3) If any of pointer

[algogeeks] Re: Find the Grid row containing all 1's except intersection point in constant time

2009-10-10 Thread Manisha
By intersection point, I mean intersection of ith row and ith coulmn. For instance, 1 0 0 1 1 1 1 1 0 Here the answer should be 3 as 3rd row contain all 1's except(3,3). On Oct 10, 9:15 pm, Ramaswamy R ramaswam...@gmail.com wrote: Whats with the intersection point? Intersection of what

[algogeeks] 100!

2009-10-10 Thread vicky
find some of all the digits in number-100! --~--~-~--~~~---~--~~ 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

[algogeeks] optimum algo for second largest

2009-10-10 Thread sankalp
can anyone give me algorithm for finding the second largest element in array using tournament method requiring n+logn-2 comparisons --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to

[algogeeks] Re: Interesting array multiplication problem

2009-10-10 Thread harit agarwal
traverse the array once and ge product of all elements , this is dividend now again traverse for each a[i] do division(divisor,a[i]) code for division without using / #includestdio.h int dividend, divisor, remainder; /* Division function Computes the quotient and remainder of two numbers using

[algogeeks] Re: 100!

2009-10-10 Thread Vivek S
hope you mean find *sum* of all the digits in number-100! :) 2009/10/11 vicky mehta...@gmail.com find some of all the digits in number-100! -- Reduce, Reuse and Recycle Regards, Vivek.S --~--~-~--~~~---~--~~ You received this message because you are

[algogeeks] Re: Find the Grid row containing all 1's except intersection point in constant time

2009-10-10 Thread Ramaswamy R
On another thought, constant time complexity would not be possible with no constraints on the size of the matrix or any limitation on what possible data it would have. It wouldn't be possible to do it in 25 comparisons for a 1 Million x 1 Million grid. If there is no restriction on the data as

[algogeeks] Re: 100!

2009-10-10 Thread Anil C R
Project Euler!! --~--~-~--~~~---~--~~ 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