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.

Recommended Answers

All 2 Replies

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

well size shouldn't exceed 1 million

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.