Don't ask to ask, just ask | |
PerlMonks |
Re: recursive creation of attached objects?by Marshall (Canon) |
on Sep 14, 2012 at 04:18 UTC ( [id://993632]=note: print w/replies, xml ) | Need Help?? |
I'm trying to make a binary tree object which uses a recursively called new() method to create a tree n nodes deep I would think that the basic interface is wrong. "new" should create a "virgin" tree. There should be another method to add leaves to this tree $bin_tree->add_leaf(...), perhaps? I would not use the "new" method for this purpose.
In Section
Seekers of Perl Wisdom
|
|