Does anybody know how array languages handle pointers and trees?
Does anybody know how array languages handle pointers and trees?
[1]: https://youtu.be/DsZdfnlh_d0
If you have a non-cyclic tree (e.g. a 256-trie) you can nest it directly: @/ will traverse to nodes, and COW keeps updates from trashing memory too much.
However trees are rarely the best data structure: Binary search on a sorted list can beat b-trees simply because the end of the search will already be in cache, so for a routing table of IP address ranges, I use something like:
ipStart where ipStart bin xAnd I translated some of Aaron Hsu's APL ideas into k5. With a little massaging they work just as well: https://github.com/JohnEarnest/ok/blob/gh-pages/examples/key...