Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: recursive creation of attached objects?

by Marshall (Prior)
on Sep 14, 2012 at 04:18 UTC ( #993632=note: print w/ replies, xml ) Need Help??


in reply to recursive creation of attached objects?

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.


Comment on Re: recursive creation of attached objects?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://993632]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (21)
As of 2015-07-07 21:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls