recursionless dfs
memory-conscious connected components algorithm