Re: [algogeeks] Rabin Karp

2010-04-20 Thread Black Diamond
http://stackoverflow.com/questions/711770/fast-implementation-of-rolling-hash Thanks & Regards BL/\CK_D!/\MOND On 4/20/2010 12:43 AM, siddharth srivastava wrote: Can anyone help out in implementing Rabin Karp Algorithm ? Thanks -- You received this message because you are subscribed to the Googl

Re: [algogeeks] Approximating a spiral with a sequence of arcs

2010-04-20 Thread Black Diamond
what are u doing in your current solution. to me the solution seems to be simple take a Grid of N*N and put yourself at N/2,N/2 from there you start walking in spiral way :) and print the gird. :-\ ;-) Thanks & Regards *BL/\CK_D!/\MOND* On 4/20/2010 2:33 AM, mythagel wrote: Hello all, Is the

[algogeeks] Minimum Vertex Cover

2010-04-20 Thread Black Diamond
can any one explain me how to find the minimum vertex cover through *König's theorem* the algorithm is confusing me :) :-( -- Thanks & Regards *BL/\CK_D!/\MOND* -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send ema

[algogeeks] Finding all prime less than 10^8

2010-04-10 Thread Black Diamond
i have an problem on SPOJ to find all the prime less than 10^8 https://www.spoj.pl/problems/TDPRIMES/ i am using sieve of erastosthenes algorithm to find primes my code is taking in my machine around 10.9 to 11.2 seconds and time limit is 10 second how i can change my code or any diff logic..???

Re: [algogeeks] Re: Finding youngest common ancestor of two nodes in a binary tree

2010-04-08 Thread Black Diamond
depending upon the situation if you have to find the youngest ancestor once then what rahul singh can be done if the situation is you have mutliple query then do it in the following way preprocessing : make a reversed tree eg ABC / \