Pathologically Eclectic Rubbish Lister | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
You are doing a Depth First Search, so 'E' is the first result. Perhaps what you want is a Breadth First Search?
Update: that still wouldn't give you what you expect though...I think BFS would return A, B, b, C, c, D, d, E, e). Last Update?: What you want is DFS, but use $t->preorder instead of $t->dfs. This returns (A, b, c, d, e, B, C, D, E) which maybe acceptably close to what you are expecting. Aha, and use the next_alphabetic option:
In reply to Re: How do I use Graph::Traversal?
by runrig
|
|