digitalmars.D.learn - Is this a good tree?
- Vladimirs Nordholm (16/16) Jun 02 2020 Hello.
- Q. Schroll (4/20) Jun 02 2020 You might want to check out this:
- Vladimirs Nordholm (3/9) Jun 02 2020 Thank you!
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.
Jun 02 2020
On Tuesday, 2 June 2020 at 11:44:10 UTC, Vladimirs Nordholm wrote: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.You might want to check out this: https://en.wikipedia.org/wiki/Trie Possibly, that's exactly what you're looking for.
Jun 02 2020
On Tuesday, 2 June 2020 at 12:34:53 UTC, Q. Schroll wrote:On Tuesday, 2 June 2020 at 11:44:10 UTC, Vladimirs Nordholm wrote:Thank you! I believe this is exactly what I need ;)[...]You might want to check out this: https://en.wikipedia.org/wiki/Trie Possibly, that's exactly what you're looking for.
Jun 02 2020