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/

Comments

  1. Yes but I need small code with no external dependencies

    ReplyDelete
  2. Looks really cool! What license is it? I couldn't see one specified on Github or at the top of the file.

    I 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.

    ReplyDelete
  3. 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/

    ReplyDelete
  4. I 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

    I 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...

    ReplyDelete

Post a Comment