lt;&lt; endl; 
    else 
      cout &lt;&lt; &quot;) = &quot; &lt;&lt; p[*vi] &lt;&lt; endl;
  }
</pre>
The output is:
<pre>
  parents in the tree of shortest paths:
  parent(0) = no parent
  parent(1) = 4
  parent(2) = 0
  parent(3) = 2
  parent(4) = 3
</pre>

<br>

<h3>Notes</h3>

<a name="1">[1]</a> The new version of Dijkstra's algorithm now includes
a named parameter for recording predecessors, so a predecessor visitor
is no long necessary, though this still makes for a good example.

<br>
<hr>
<table>