954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

help with a hash function...

okay, so i gotta make a good enough hash function that should be able to make me a key for out of two integers ( -1000000 <= x, y <= 1000000 ), and should work...well atleast 80% of the time so i could store these in an one-dimensional array... i've just started working with that stuff... and i gotta say i've tried x*P1+y*P2 and so with many combinations of prime numbers... and it ain't good enough. gief helpppp! please.

gregorynoob
Junior Poster in Training
86 posts since Jun 2008
Reputation Points: 12
Solved Threads: 5
 

what about for hash(x,y) = (x+2000000)+y. You never did mention the hash variable size...

dougy83
Posting Whiz in Training
275 posts since Jun 2007
Reputation Points: 85
Solved Threads: 45
 

well size shouldn't exceed 1 million

gregorynoob
Junior Poster in Training
86 posts since Jun 2008
Reputation Points: 12
Solved Threads: 5
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You