The non-allocating breadth-first search is done with successive calls to Depth-First search, each time looking for specific depth levels.
This trick could be made much faster if we could tell the DFS to stick within a target min and max depth, allowing it to exit deeper parts of the tree and skip past shallower parts of the tree.
The non-allocating breadth-first search is done with successive calls to Depth-First search, each time looking for specific depth levels.
This trick could be made much faster if we could tell the DFS to stick within a target min and max depth, allowing it to exit deeper parts of the tree and skip past shallower parts of the tree.