Another method doubt

couldn’t we solve the cities question discussed in this video using normal dfs to find the sizes of the components?

yeah we can solve it using dfs as well