Created
May 5, 2015 20:20
-
-
Save luccasiau/edd0b6efe259b9621681 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// componente[i] se trata da componente do vértice i | |
// inicialmente, componente[i] = -1 para todo vértice | |
// faremos a DFS como sendo uma função recursiva | |
// antes de chamar a DFS no primeiro nó, definimos sua componente | |
DFS(vértice X): | |
para todo V vizinho a X: | |
se (componente[V] == -1): | |
componente[V] = componente[X] | |
DFS(V) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment