# O primeiro passo do bfs visita todos os vértices que

• Notes
• 71

This preview shows pages 7–9. Sign up to view the full content.

O primeiro passo do BFS visita todos os vértices que estão a uma aresta de distância de v, o segundo passo visita vértices que estão a duas arestas de distância de v e assim por diante. Os desenhos a seguir ilustram esta interpretação do BFS. v v 3 1 a 1 • • b b 4 a 2 3 c d e 5 5 e 6 f 7 g 4 • • 2 6 c d f 8 h O algoritmo é dado abaixo. Algorithm BFS (G, V) Entrada: Grafo G = (V, E) e vértice v. begin marque v coloque v no fim da fila F 7

This preview has intentionally blurred sections. Sign up to view the full version.

This is the end of the preview. Sign up to access the rest of the document.
• Summer '00
• Aula4-IntroducaoC
• =, algoritmo dfs

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern