DepthFirst

constructor(maxDepth: Int = -1, postOrder: Boolean = false)

Parameters

maxDepth

caps the traversal to nodes at depth at most maxDepth; a non-positive value (the default, -1) means "unbounded"

postOrder

if true (false by default), a node is yielded only after all the nodes reachable from it have been (post-order traversal), rather than as soon as it is first reached (pre-order traversal)