|
Post by tenochtitlanuk on Sept 1, 2023 10:08:10 GMT -5
I've been following the references to associated arrays and dictionaries- and Carl's dictionary example.
I dug up a demo program of mine which shows the benefit of hashing for such uses. This is where instead of filling an array sequentially, and then having to look through all entries until you find the one your key references, you can jump straight to it- or to very close- in one step. ( related to but separate from cryptographic use of hashing)
Still tinkering with the demo's webpage- but below is the sequence of filling from a data set about countries and populations, with examples of adding and deleting. Slowed down for display...
Will post link to the code and demo page in a day or two...
|
|
|
Post by Carl Gundel on Sept 1, 2023 10:12:44 GMT -5
I've been following the references to associated arrays and dictionaries- and Carl's dictionary example. I dug up a demo program of mine which shows the benefit of hashing for such uses. This is where instead of filling an array sequentially, and then having to look through all entries until you find the one your key references, you can jump straight to it- or to very close- in one step. ( related to but separate from cryptographic use of hashing)
Still tinkering with the demo's webpage- but below is the sequence of filling from a data set about countries and populations, with examples of adding and deleting. Slowed down for display...
Will post link to the code and demo page in a day or two... <image snipped> Yes, hashing is a different thing altogether. I invented my own hashing code for a business application when I worked at Alessi Data Technology back in the 1980s. My dictionary code relies on the speed at which the LB string functions can do lookup. For large sets of data you might try a different technique, but then the question is at what data set size does the hashing code written in LB begin to outperform the string functions written in Smalltalk?
|
|