[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: A bi-direction hashtable

2008-03-31 Thread Ridvan
>>Given value you can easily find the key using hash function it self Maybe you mean if you have the hash value of the key? But it is different than value which is stored in the hashtable? On Mar 27, 9:39 am, "phani bandaru" <[EMAIL PROTECTED]> wrote: > Given value you can easily find the key u

[algogeeks] Re: Algorithm Question Help Please!!!

2008-03-26 Thread Ridvan
I think you are doing the same thing the Simplex method does. Sorry but the Simplex does it better :) because you are increasing and decreasing only by 1 hour at a step. On Mar 25, 3:18 pm, Ashesh <[EMAIL PROTECTED]> wrote: > The PDF containing the solution is > here:http://groups.google.com/gr

[algogeeks] Re: An interesting graph problem

2008-02-25 Thread Ridvan
Maybe this will work: Starting from each vertex using BFS calculate the shortest path which passes through vertexes from all the colors. Best, Ridvan On Feb 24, 2:00 pm, "Ajinkya Kale" <[EMAIL PROTECTED]> wrote: > On 2/24/08, Sticker <[EMAIL PROTECTED]> wrote: >

[algogeeks] Re: Frog Problem

2008-02-24 Thread Ridvan
> Oh. By "dynamic programming," you just mean evaluating the Fibonnaci > recurrence sequentially rather than recursively. http://en.wikipedia.org/wiki/Dynamic_programming Not only this. The recursive solution is O(2^n) >>> O(n). Ridvan On Feb 24, 4:38 pm, Dave

[algogeeks] Re: Frog Problem

2008-02-23 Thread Ridvan
not 0; The simmilar solution for printing the paths. Best, Ridvan On Feb 23, 4:16 pm, Dave <[EMAIL PROTECTED]> wrote: > Please provide more details. > > Dave > > On Feb 22, 8:11 am, Ridvan <[EMAIL PROTECTED]> wrote: > > > Dinnamic programming problem. > &g

[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: what is the best solution for this kind of searching ?

2008-02-23 Thread Ridvan
e, if it's zero - get rid of it, > otherwise, the heap will still be sorted by size since > the smallest range will still be the smallest. I like this solution it will be faster, but I see a small error instead of decreasing the min you should increase it, or decre

[algogeeks] Re: Frog Problem

2008-02-22 Thread Ridvan
Dinnamic programming problem. Just read any example about it. On Feb 12, 8:13 am, "Abhijeet Singh" <[EMAIL PROTECTED]> wrote: > I have stones numbered from A-K and I have a Frog which can make a jump > of one stone at a time or two stones at a time but no more then that. > I will explain , assu

[algogeeks] Re: Fwd: Document-term matrix

2008-02-22 Thread Ridvan
If by "Document term matrix" you mean list of unique words in a documet - just use hashtable. On Feb 19, 6:23 pm, "sangeetha rajagopalan" <[EMAIL PROTECTED]> wrote: > Hi,I am in urgent need of a C code to represent a Document term matrix. I > mean, given a text file, my output should be a Docume

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

2008-02-22 Thread Ridvan
Well if some preprocessing may be done just store the largest number and increase it. If the number has to be somewhere in between the 100 numbers I would do it in this way: Define a Range class: Range{int min, int max} In the preprocessing split the numbers to free Ranges. Define Heap Whe

[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 -~--~~~~--~~--~--~---