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.
Feed/

In what order would a depth-first traversal visit the nodes?

Channel

Brisk

1 page

"Suppose we traversed the graph below in depth-first fashion, starting with node P. In what order would we visit the nodes? N O P Q R S T There are two possible answers: P, Q, R, S, T, N, O, or else P, O, N, T, S, R, Q. (The choice just depends on whether we go “left” or “right” initially.) Note in particular that either O or Q is at the very end of the list."

Flowchart preview
Series cover
👍
0
0 comments0 shares

Sign in to view and post comments.