title: How can we implement Priority Queue instead of Queue to Breadth-First Traversal?
body: <p>We know that for Breadth First Traversal we should use 'Queue'.</p>
  <p>Example:<br />
  <img src="https://i.stack.imgur.com/aCzzc.png" alt="https://i.stack.imgur.com/aCzzc.png" /></p>
  <p>For this graph, if we start from '0', the visit order will be like this : 0 1 3 8 7 2 4 5 6.<br />
  What would be the visit order if we use a priority queue?</p>
  <p>Edit: Priority Queue will be min-heap.</p>