Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re3: Depth First Search through Digraph Results in Memory Leak

by Hofmator (Curate)
on Jan 09, 2004 at 13:44 UTC ( #320109=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # this marks the current vertex
    $explored->{$node->{_id}}++;
    
    ...
       # not of the vertex!!
       $do_search->($link->{_to}) unless ($explored->{$link->{_id}});
    }
    
  2. or download this
    $explored->{$node->{_id}}++;
    foreach my $link (@{$node->{_outlinks}}) {
       my $new_node = $link->{_to};
       $do_search->($new_node) unless ($explored->{$new_node->{_id}});
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2014-09-22 05:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (180 votes), past polls