Questão BFS/DFS

 

Analyze the statements below, knowing that DFS and BFS algorithms start in the node "a" and the adjacency list is sorted in alphabetical order.

 

I.  During a BFS execution, three nodes that are already visited are verified (thus not being visited again);
II. There is one back edge in the graph;
III. If we remove the edges CD and EF, the resulting graph is a bipartite graph;
IV. The DFS execution would restart twice in this graph, creating two different trees;

The correct statements are: 

a) I and III

b) Only II

c) II and III

d) I, II and IV

e) None of the above

 

Original idea by: Giorgio Rossa 

 

 

Comentários

  1. Boa questão. Alternativa correta é a E, certo?

    ResponderExcluir
    Respostas
    1. Obrigado! Era para ser a C... Na I pelas minhas contas apenas 2 nós são checados novamente, e a DFS na IV só cria uma árvore.

      Excluir

Postar um comentário

Postagens mais visitadas deste blog

Push-relabel algorithm

TSP Question