Message from JavaScript discussions
May 2017
— I think that is better than trying to let the data structure itself define sections, at least when you use a linked list like that
Then, on set
, you would lookup existing characters, then add only missing characters but to the end of the array
— To represent something, maybe some map like this:[0,1,2,56,78]
— But integers are also pass-by-value, so that defeats the purpose of trying to be more memory efficient, but you get the idea
— So maybe instead, a Bloom filter would work better, since you are re-using the same hash for multiple objects
— It is a simple bit array
— "While risking false positives, Bloom filters have a strong space advantage over other data structures for representing sets, such as self-balancing binary search trees, tries, hash tables, or simple arrays or linked lists of the entries."
— Hmm
— Since there can only be 26 letters and 10 numbers represented, I think it should work perfectly
— "However, if the number of potential values is small and many of them can be in the set, the Bloom filter is easily surpassed by the deterministic bit array"
— It does a single loop str.length times for every addition and lookup
— length
property is very efficient, is a stored integer