Version 17 of Tree

Updated 2005-06-02 15:12:12 by escargo

A tree is an acyclic directed-graph data structure where one node (the root) has no predecessor, and all other nodes have exactly one predecessor. Tress can be used, e.g., for representing the result in syntax parsing. Every XML document has a tree structure.

Tcllib contains a tree data structure.

Documentation for it can be found at http://tcllib.sourceforge.net/doc/tree.html .

This module of the tcllib data structures collection provides the data structure portion of a tree structure.

The tcllib Tree would be more useful if nodes could be arbitrary objects (specifically, if they could be incr Tcl objects).

To that end, I made some mods which string map {:: @} in the creation of namespace data arrays. Worth adding to the mainline? CMCc


LV In the following text, I notice a number of cases where GUI widget sets have some sort of tree widget. In each of these cases, is the data structure intermingled with the data representation? Seems a shame that someone doesn't just build a graphically viewable widget that depends on a data structure that is separate. That way, someone could do work with one piece of code, and then, in other pieces, display that data. Seems like a natural method of developing and maintaining code....


Also, BWidget has a Tree widget. (See Tree nodes in motion - starDom - LemonTree).


For a lightweight approach, see Trees as nested lists.


Related topics:


[ Arts and Crafts of Tcl-Tk Programming | Category Command, package tcllib, module struct | Category Data Structure | ]