4 ms·
the boolean array indexed by char effectively is a hashtable isn't it? where the hashing algorithm is index = ord(theChar).
by user24 16y ago
the boolean array indexed by char effectively is a hashtable isn't it? where the hashing algorithm is index = ord(theChar).
- user24 16y agothat was a genuine question. I think I'm right, but I might not be. Judging by the upvotes it looks like I am, but I'd like someone to come forward and say "Yes, that's correct" explicitly.
- mrud 16y agoYes, that's correct.
- user24 16y agothanks :)
- alextp 16y agoThis is not quite true. It's a mapping, but it's not a hash table because the mapping is bijective (while hash tables just project the keys into the table space). So there is no possibility of collision, the number of keys is fixed, etc. It's just a table, like any other, and most of what is implied when talking about hash tables does not necessarily apply here.