Dylan Evans
2/18/2009 4:10:00 AM
[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.
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