Bifalgorithm post · Brisk · Chapter 1
In what order would a depth-first traversal visit the nodes?
In what order would a depth-first traversal visit the nodes? (Brisk · Chapter 1) — "Suppose we traversed the graph below in depth-first fashion, starting with…
Ideas in this flowchart
- Profondeur du parcours du graphe à partir du nœud P
- Le graphe contient les nœuds N, O, P, Q, R, S et T.
- Le parcours commence au nœud P.
- Quel côté est choisi en premier ?
- Si l’on va d’abord vers la gauche : P, Q, R, S, T, N, O.
- Si l’on va d’abord vers la droite : P, O, N, T, S, R, Q.
- Dans les deux parcours, O ou Q est visité en dernier.
