Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

the boolean array indexed by char effectively is a hashtable isn't it? where the hashing algorithm is index = ord(theChar).


This 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.


that 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.


Yes, that's correct.


thanks :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: