Is this a good tree?

Vladimirs Nordholm v at vladde.net
Tue Jun 2 11:44:10 UTC 2020


Hello.

I want to create a tree which maps sequences of numbers to data. 
ex:
- [1, 2]    -> 1
- [1, 3, 1] -> 2
- [1, 3, 2] -> 3

I have no prior knowledge of what makes a good tree, and I am 
unsure if what I've got is good. I mean it works, but if anyone 
with more knowledge of trees or D-lang would mind giving some 
feedback I would be more than happy.

I've made a scaled-down, "in essence", runnable example of what I 
have here: https://run.dlang.io/is/JI8T2T

For more context, my actual code (with extra boilerplate + 
project specific things) can be found here: 
https://github.com/vladdeSV/scone/blob/develop/source/scone/os/posix/input/input_tree.d

Once again, any feedback is greatly appreciated.


More information about the Digitalmars-d-learn mailing list