Re: [algogeeks] Appropriate data structure

2012-07-15 Thread rspr
I think by using min/max heap we can fetch the kth largest/smallest data from the heap. But here there is one more point how to ensure that the data is smallest in last kth day. Here you can use interval/segment(augmented version of heap tree) tree, where u can store the interval/segment on the

[algogeeks] Re: [amazon ] Finding Sub segment

2012-06-26 Thread rspr
just have a look on segment tree ( u can found good study material on segment tree at topcoder algorithm tutorial) On Monday, 25 June 2012 18:13:50 UTC+5:30, Navin Kumar wrote: please provide some good data structure to solve this problem: http://www.careercup.com/question?id=14062676

[algogeeks] Re: MS Question: Add two large numbers where the numbers are stored in an array format

2012-06-26 Thread rspr
- in general we use polynomial addition for the same. If the numbers are carrying some additional information as ( particular base or pattern) another mechanise can be designed On Tuesday, 26 June 2012 15:40:39 UTC+5:30, ashgoel wrote: Best Regards Ashish Goel Think positive and find fuel

[algogeeks] How can we rank the players in a relative game Ranking Players

2012-05-13 Thread rspr
This is a live problem from interviewstreet.com: In the game challenges that we host, one practial problem that we face is to rank the contestants. Contestants need to submit code for a game problem and we pair up them against each other to see their relative performance. The aim of this

[algogeeks] find the sum of very large binary sequence in O(n)

2012-02-12 Thread rspr
I have two binary sequences x and y (10 bits long)...I am taking a bool array to store it.I have to implement the summation operation( at most 40 summation operation)...while the bits patter in changing in x and yin my approach before performing a sum I am taking care of a. to

[algogeeks] how can we check for primality for very large number

2012-02-11 Thread rspr
How can we check for the primality for very large number like 10^20 or more. It is not stored in integer So integer operation would not work on it. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

[algogeeks] Practical way to check the primality in efficent time

2012-02-11 Thread rspr
what are the efficient ways to check that a given number is primer assuming the numbers can be large. -- 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

[algogeeks] Re: How many ways n points can be connected

2012-02-09 Thread rspr
(n,m) = C(n*(n-1)/2, m) - ∑(∑C(n-1, n'-1) * f(n', m') * C((n-n')*(n-n'-1)/2, m-m') for m' in [n'-1,m]) for n' in [1, n-1] (C(N, K) is binomial coefficient choosing K from N) The overall time complexity is O(m^2*n^2), and space complexity is O(mn) On 2012-2-8 12:03, rspr wrote: Hi All

[algogeeks] How many ways n points can be connected

2012-02-08 Thread rspr
for every event in sample space.is there any other way that can optimize this calculation or may it possible that we can directly calculate it. . rspr -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email