[algogeeks] Chinese remainder theorem

2008-04-20 Thread Ridvan Gyundogan
Hi All, I am having hard time with this theorem as defined in "Introduction to Algorithms" by Cormen ... I've read the Chinese Remainder theorem in other books and it is clear, but Cormen tells something different, they talk about Cartesian product, descriptive structure etc. If anyone un

[algogeeks] Re: what is the best solution for this kind of searching ?

2008-02-23 Thread Ridvan Gyundogan
> I'm not sure why you think a plain list would be O(N). It seems to me > that it would be O(1). I agree, my idea in the beginning was to split the largest range --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Algori

[algogeeks] Re: can you solve these questions!!!

2008-02-04 Thread Ridvan Gyundogan
Yes this seems to be working. On Feb 3, 6:50 pm, "Aravind Narayanan" <[EMAIL PROTECTED]> wrote: > On Feb 3, 2008 10:12 PM, Ridvan Gyundogan <[EMAIL PROTECTED]> wrote: > > > > > Hi Aravind, > > I think it will not work in this array: > > {1,2,3,

[algogeeks] Re: can you solve these questions!!!

2008-02-03 Thread Ridvan Gyundogan
Hi Aravind, I think it will not work in this array: {1,2,3,4,5,6,7,7,7,7} It would give currentelem=7 and c=3 but 7 is not repeated 6 times. Best > Init c = 1; > Init elem = first character in the array. > for each element in the array (other than the first one): >if currentelem == elem:

[algogeeks] Re: can you solve these questions!!!

2008-02-03 Thread Ridvan Gyundogan
for #2: Just create a hashtable Number-> Counts. Make one iteration through the whole List and make hashtable(Number)=hashtable(Number)+1. No comparisons so far. Then if size(hashtable)http://groups.google.com/group/algogeeks -~--~~~~--~~--~--~---