title: Priority Queue Issue
body: <p>Am implementing the A* algorithm based on this tutorials:  </p>
  
  <pre><code>create the open list of nodes, initially containing only our starting node
     create the closed list of nodes, initially empty
     while (we have not reached our goal) {
         consider the best node in the open list (the node with the lowest f value)
         if (this node is the goal) {
             then we're done
         }
         else {
             move the current node to the closed list and consider all of its neighbors
             for (each neighbor) {
                 if (this neighbor is in the closed list and our current g value is lower) {
                     update the neighbor with the new, lower, g value 
                     change the neighbor's parent to our current node
                 }
                 else if (this neighbor is in the open list and our current g value is lower) {
                     update the neighbor with the new, lower, g value 
                     change the neighbor's parent to our current node
                 }
                 else this neighbor is not in either the open or closed list {
                     add the neighbor to the open list and set its g value
                 }
             }
         }
     }
  </code></pre>
  
  <p>Now i have two priority Queues for the open list and the closed list.</p>
  
  <p>After moving a node from the open list to the closed list, i must generate its neighbours and check them one by one if they are also in the closed list and perform an operation as described above. The problem is i can only peek() only the head of the queue and compare to the generated neighbours. I can't access the rest of the nodes in the queue in order to compare them as well.</p>
  
  <p>My questions is:</p>
  
  <p>how can i compare the neighbours to the nodes in the closed list. Or should i use a different data structure for the closed list?</p>
  
  <p>thanks</p>