Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Hash table

Name: Anonymous 2012-02-12 0:24

Is it ever possible to have a Hash table that can do get,put,remove @ O(1) for Strings?

calculating the hash for the String alone is O(n), is it not? [that's if you want to produce a good hash that won't collide all over the place]

Name: Anonymous 2012-03-18 3:09

>>17
righto, a subset can be represented as a function from the super set domain to true or false, where the function is true for members of the set and false for members of the super set that are not in the set being represented by the function. If the elements of the super set can be enumerated, then the function can be represented on a tape as an array of bits, where the ith bit is on if and only the ith element of the super set is in the represented set. In this case, the super set is the set of all strings, which happens to be countably infinite. So as long as the has at least countably infinite slots, we are good for storing the table. Although one would need to index into the look up table fast enough to satisfy the order one look up. It shouldn't take any time longer than the length of the string being queried. Whether or not that can be done kind of depends on what assumptions you can make about the machine.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List