[PD] Associative list datastructure
Chris McCormick
chris at mccormick.cx
Thu Nov 13 04:47:50 CET 2014
Hi *,
Attached is another vanilla implementation for a datastructure commonly
found in programming languages, sometimes called map, hashmap or
associative array where keys refer to values.
<http://en.wikipedia.org/wiki/Associative_array>
In this case the key is the first item of a list and the value is the
remainder of the list.
Internally it uses the new [text] datastructure to make it a big faster
than previous similar implementations.
This isn't a true hashmap as it doesn't use hashing for storage and
lookups, so lookup time will get slower as you add more elements = O(n).
For many of our use-cases that is probably fine.
Cheers,
Chris.
--
http://mccormick.cx/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: map.pd
Type: text/x-puredata
Size: 3445 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20141113/2cf2fd12/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: map-api.pd
Type: text/x-puredata
Size: 634 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20141113/2cf2fd12/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: map-api-help.pd
Type: text/x-puredata
Size: 715 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20141113/2cf2fd12/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: map-help.pd
Type: text/x-puredata
Size: 1144 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20141113/2cf2fd12/attachment-0003.bin>
More information about the Pd-list
mailing list