[algogeeks] Re: mapping of 2-d arrays

2010-12-23 Thread mohit mittal
how to use hash table
i have a pair (a,b) with which i want to use.
if i use hash function like  a+nb there will be number of clashes.
also , i have tried map stl in some of programs and most of them give
TLE.
So, is there a better way for this or i have to look a different
approach to this.

Thanks
Mohit
On Dec 19, 7:39 pm, juver++ avpostni...@gmail.com wrote:
 Use hash_table, it provides O(1) expected time for searching.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: mapping of 2-d arrays

2010-12-23 Thread juver++
Represent your pair in some radix system. So Hash=(a*Base + b) mod 
SomePrime.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: mapping of 2-d arrays

2010-12-19 Thread juver++
How many elements you would have at all?

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: mapping of 2-d arrays

2010-12-19 Thread mohit mittal
its like i have two number a and b both can have max value 10^6.
i have to store a value for the pair (a,b)
i also want to access in O(1) time.

On Dec 19, 5:41 pm, juver++ avpostni...@gmail.com wrote:
 How many elements you would have at all?

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: mapping of 2-d arrays

2010-12-19 Thread juver++
Use hash_table, it provides O(1) expected time for searching. 

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: mapping of 2-d arrays

2010-12-19 Thread sae
how to set class path for jasper reports in java?

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.