A free small Delphi unit to implement a generic Tree structure. I'm maybe reinventing the wheel, but haven't spent time digging to search existing similar code.
A free small Delphi unit to implement a generic Tree structure. I'm maybe reinventing the wheel, but haven't spent time digging to search existing similar code.
http://steema.com/wp/blog/2015/06/15/generic-delphi-tree-structure/
http://steema.com/wp/blog/2015/06/15/generic-delphi-tree-structure/
Yes but I need small code with no external dependencies
ReplyDeleteLooks really cool! What license is it? I couldn't see one specified on Github or at the top of the file.
ReplyDeleteI have been thinking of implementing a couple of binary tree variants recently (red-black for Horácio Filho, and balanced binary for another project) and so (license permitting) I'll have a look at your code! Although it looks very flexible and I might end up with something specialised to be a binary tree not a n-child tree.
Oops, I'll add a license file asap. This is just a simple "tree" (node with childs) with the generic data capability. For complex/sorted b-trees etc, I've seen J.Bucknall just released an update to EZDSL classes: http://blog.boyet.com/blog/blog/open-sourcing-ezdsl-on-github/
ReplyDeleteI have his book! In fact I ran into problems with his red-black tree a while ago... http://stackoverflow.com/questions/16384520/problems-with-promote-using-the-red-black-tree-implementation-from-the-tomes-o
ReplyDeleteI eventually got an implementation that passed my unit tests but I think next time I will write an RB-tree from another source.
EZDSL is very non-modern Delphi - have a look at the node structure, for example...