title: Java Priority Queue Interface Implementation
body: <p>This were the questions I was asked in the interview fews days back and I was not sure about the approach. Suggestions would be highly appreciated:</p>
  
  <p>How can I have implement PriorityQueue interface to get queue() method in O(1) and dequeue() method in O(n).</p>
  
  <p>How can I have implement PriorityQueue interface to get queue() method in O(n) and dequeue() method in O(1).</p>
  
  <p>Thanks. </p>