if (!visited.has(child)) {
          visited.add(child);
          queue.push(child);
        }
Iterative implementation of DFS that supports all use-cases.

This replaces `dfs` and will replace `dfsFast`.