example Mattias gave, my code requires that the entire structure must be walked before being able to use the results. With yours, the walk-through follows example 2, gets immediate results, and can be stopped at any point.
BTW, if you return false from your callback function, the recursive enumeration stops and unrolls everything.
The recursive version is also not constrained to be "hard-coded" to support a finite 'depth limit.'
MCM
Leave a comment: