From: Dylan Evans Date: 2009-02-18T13:10:14+09:00 Subject: Re: Tree structure - how do we link nodes together? --000e0cd172a44540c804632999f8 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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. On Wed, Feb 18, 2009 at 11:30 AM, Aldric Giacomoni <"aldric[removeme]"@ trevoke.net> wrote: > I know I could just use rubytree, which looks quite nice, but I'd like > to see what you guys would do about creating a tree and linking the > nodes together. > In C++ we'd just make pointers, so how would we do the equivalent in Ruby? > > --Aldric > > -- The UNIX system has a command, nice ... in order to be nice to the other users. Nobody ever uses it." - Andrew S. Tanenbaum --000e0cd172a44540c804632999f8--