Postagens

Mostrando postagens de agosto, 2025

Questão BFS/DFS

Imagem
  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  C D  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