[algogeeks] Amal wants to chat

2010-04-22 Thread Amal
--- Amal wants to stay in better touch using some of Google's coolest new products. If you already have Gmail or Google Talk, visit: http://mail.google.com/mail/b-d82347d001-90c4ebb70f-277069a95cbc9f5d You'll need to

[algogeeks] HASHIT in spoj.

2009-07-10 Thread Amal
Is there anyone who has solved this problem https://www.spoj.pl/problems/HASHIT/ . Its not a tough problem but i am having lots of trouble getting it accepted. Can some one who has it accepted give some test cases. --~--~-~--~~~---~--~~ You received this message bec

[algogeeks] Re: finding whether the number is prime or not ...

2009-03-23 Thread Amal
Is there any proof for this ? On Fri, Jun 27, 2008 at 7:29 AM, Arunachalam wrote: > What is the maximum value of number that you need to find out? > > A 32 bit number is prime if it satisfies the Fermat's theorem for 2,3,5,7 > and 11. This is the fastest way to find out whether a number is prime

[algogeeks] Re: 答复: [algogeeks] Re: a no n-recursive algorithm that prints all the nodes of a binary tree in O(n)

2008-02-11 Thread Amal
Actually we should play with the pointers. We should move the pointers that are NULL. The left pointer that is NULL should point to the inorder predecessor and right one the successor. And then we can re-form the tree. Amal. 2008/2/12 James Fang <[EMAIL PROTECTED]>: > this requires

[algogeeks] Re: Sorting o(n) time

2007-03-17 Thread Amal
Do we have to partition after finding the kth element ? Will the Array not be partitioned when the base condition is met ? Amal. On 3/16/07, Rajiv Mathews <[EMAIL PROTECTED]> wrote: > > > On 3/16/07, Karthik Singaram L <[EMAIL PROTECTED]> wrote: > > > > How w

[algogeeks] Re: Circle Arrangement Problem

2006-12-19 Thread Amal
Only Males remain - Does it mean all the males should remain or the people remain should be males ? If the people remain should be males then it is just josephus problem or it is an extension to it. Amal. On 12/18/06, Darth <[EMAIL PROTECTED]> wrote: > > > thanks everyone for y

[algogeeks] Copying Books from Sphere online judge.

2006-10-09 Thread Amal
http://www.spoj.pl/problems/BOOKS1/ For this problem I have a Dp solution of O(n^3) and another solution based on Binary search.Is there a better DP (dynamic Programming ) soln of order less than n^3 . Amal. --~--~-~--~~~---~--~~ You received this message

[algogeeks] Re: Quicksort & duplicates

2006-08-25 Thread Amal
Actually Iam not sure  if it might help .. There is a sorting mechanism called introsort which is used in the Standard Template library of C++ . Try that too .. its a combination of Quick sort and Merge sort I guess. Amal.On 8/25/06, [EMAIL PROTECTED] <[EMAIL PROTECTED] > wrote:3-way quicksort - ne

[algogeeks] Solution needed !!

2006-08-25 Thread Amal
There are 2 arrays say array A and array B given whose size is 'n'. Now i have to find the first n maximum values of a[i]+b[j] .  I would like to know O(n) or O(n logn ) solutions if some exist.Amal. --~--~-~--~~~---~--~~ You received this message because you are su

[algogeeks] Re: Which is the fastest solution for comparing two arrays?

2006-07-19 Thread Amal
array. Amal. On 7/20/06, Bruno Avila <[EMAIL PROTECTED]> wrote: To sort an array A you could use Radix Sort, which complexity is O(d*n), where d = log2(max(A)). So,sort the first array -> O(d*n)sort the second array -> O(e*n)compare the two arrays -> O(n) the solution : (d+e+1)*O(n) = O