Logo

Programming-Idioms

History of Idiom 130 > diff from v9 to v10

Edit summary for version 10 by daxim:
New Perl implementation by user [daxim]

Version 9

2019-09-27, 17:26:18

Version 10

2019-09-28, 00:43:43

Idiom #130 Depth-first traversing in a graph

Call a function f on every vertex accessible for vertex v, in depth-first prefix order

Illustration

Idiom #130 Depth-first traversing in a graph

Call a function f on every vertex accessible for vertex v, in depth-first prefix order

Illustration
Extra Keywords
dfs
Extra Keywords
dfs
Imports
use Tree::Fast qw();
Code
my $iter = $tree->traverse;
while (my $v = $iter->()) {
    f($v);
}
Doc URL
http://p3rl.org/Tree::Fast#traverse