From: Aldric Giacomoni <"aldric[removeme]"@...> Date: 2009-02-18T23:29:51+09:00 Subject: Re: Tree structure - how do we link nodes together? Dylan Evans wrote: > [Note: parts of this message were removed to make it a legal post.] > > I would be inclined to use an array, part of the beauty of dynamic languages > is the typeless nature of arrays which does away with a lot of management > code, in c++ trees i normally write a base node class then branch and leaf > nodes which is a lot of work compared to [x, [y, z]] > Of course if you wanted to create branch nodes for some custom purpose then > you could just assign the children to it since they are passed by reference. > > How would .. passing the children by reference work? Is that the same thing that Robert is talking about? The idea of an array is simple enough that it might work.. I should be able to write something to handle however many layers deep the arrays go.. But I think a tree may be a little handier to handle things like deleting a node and its children. --Aldric