(
nodeIterable: Graph.NodeWalker<N>
)
| 3430 | |
| 3431 | // Utility function that works with any NodeWalker |
| 3432 | function collectNodes<N>( |
| 3433 | nodeIterable: Graph.NodeWalker<N> |
| 3434 | ): Array<number> { |
| 3435 | return Array.from(Graph.indices(nodeIterable)).sort() |
| 3436 | } |
| 3437 | |
| 3438 | // Both traversal and element iterators implement NodeWalker |
| 3439 | const dfsNodes = Graph.dfs(graph, { start: [0] }) |