anonymous
  • anonymous
umm well a string of three characters ( T,C,G,A) , from among these, will be given to the hash function which will generate an index. Can i simply do something like this, if the input is TTT index is 0 , if TCT , index is 1 and so on
Computer Science
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
jamiebookeater
  • jamiebookeater
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
int findIndex ( char *arr ) { int sum , x , i , b , z ; i = 0; int y = strlen(arr); x = arr[0]; x = (x*x)%10; b = arr[1]; z = arr[2]; z = (z*z); sum = x-b+z; return (sum%64); }
anonymous
  • anonymous
I have this hash function , it gives 20 collissions . Is this a correct hash function ? Also how can i make it a perfect hash function
myininaya
  • myininaya
omg i don't know this much about hash functions i only really know about the math behind it i;m sorry :(

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
:( its ok :)
shadowfiend
  • shadowfiend
How much capacity will your hashtable have? That will decide whether you will find it possible to have a perfect hash function or not.
anonymous
  • anonymous
hash table can be of 128 size at maximum
anonymous
  • anonymous
I imagine there are different implementations of hash. You will have some collisions depending on the number of different inputs you have. Although you can build your own hash functions as you describe above, the built in implementations are likely to be more efficient and set up so that the compiler can optimize them better than probably anything you would write. If your task is not specifically to build a hash implementation, I would go with the built in class(es).
shadowfiend
  • shadowfiend
Ok, if the table can be 128 size maximum, 4 letters 3 at a time gives you a maximum of 24 permutations, so you know you can find a perfect hash function. You need to basically figure out a way that each possible string can be assigned a number from 0 to 24, and then any hashtable size above 23 will have a perfect hash function for it.
anonymous
  • anonymous
Thanks alot everyone! :)
shadowfiend
  • shadowfiend
You're welcome :)

Looking for something else?

Not the answer you are looking for? Search for more explanations.