title: priority queues and dijkstra
body: <p>Explain to me how to construct a priority queue and why you have to construct that way as though the limit of my my experiences with priority queues is knowing what a queue is (I have never used one in my life).</p>
  
  <p>When I'm looking at this website:
  <a href="http://comsci.liu.edu/~jrodriguez/cs631sp08/c++priorityqueue.html" rel="nofollow">http://comsci.liu.edu/~jrodriguez/cs631sp08/c++priorityqueue.html</a></p>
  
  <pre><code>priority_queue&lt;Time, vector&lt;Time&gt;, CompareTime&gt; pq;
  </code></pre>
  
  <p>I understand that Time is so that you have a queue of Times, Compare Time is what determines the priority of which a time is placed into the queue, but why does <code>vector&lt;Time&gt;</code> need to be in the constructor?</p>
  
  <p>About Dijkstra:
  I'm implementing a graph as a vector of nodes, which each node containing a list of all its neighbors positions in that vector), so it looks something like this:</p>
  
  <pre><code>class Node {
    protected:
    string name;
    int value;
    list&lt;int&gt; nodes
  }
  </code></pre>
  
  <p>How would I implement this part of Dijkstra:</p>
  
  <pre><code>for each vertex v in Graph:                                
      dist[v] := infinity ;                               
      previous[v] := undefined ;     
  </code></pre>
  
  <p>for dist[v] = infinity, I'm assuming I set the value of every node to infinity, but what variable would allow me to do that? And for previous[v], what does it mean by undefined?</p>