Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Infinite loop yet no loop

by gjb (Vicar)
on Mar 18, 2004 at 19:07 UTC ( #337769=note: print w/ replies, xml ) Need Help??


in reply to Infinite loop yet no loop

Are you sure the root of the tree is added? If not, and you don't handle this, nothing will ever be added.

Just my 2 cents, -gjb-


Comment on Re: Infinite loop yet no loop
Re: Re: Infinite loop yet no loop
by ido50 (Scribe) on Mar 18, 2004 at 19:26 UTC
    Yes, the root is always created and is kind of a dummy entry.

    -------------------------
    Live fat, die young
Re: Re: Infinite loop yet no loop
by bart (Canon) on Mar 18, 2004 at 20:22 UTC
    Goog thinking.

    To the OP: keep track of whether anything changed in the loop, otherwise it's time to abort. For example keep track of the count of items in the buffer, and if it's the same before and after the iteration, nothing has changed, and it's useless to go on.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2014-07-29 00:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (211 votes), past polls