title: Underlying DataStructure of Java PriorityQueue
body: <p>Referencing from the book <a href="https://www.amazon.in/Java-Complete-Reference-Herbert-Schildt/dp/9339212096" rel="nofollow noreferrer">Java: The Complete Reference</a>, &quot;Queue&quot; interface extend &quot;Collection&quot; interface. Also, &quot;PriorityQueue&quot; extends &quot;AbstractQueue&quot; class and implements &quot;Queue&quot; interface.</p>
  <p>Also, as per lots of articles over Internet, Heaps provides the most efficient Priority Queue implementation considering both Insert and Remove in O(logn). And being complete binary tree, heaps can be implemented simply on an array/list.</p>
  <p>My question is, If heaps are efficient for Priority Queues, than why <code>PriorityQueue</code> uses a <code>Queue</code> interface? Why it's not using <code>List</code> interface? Otherwise, what is the underlying concept/idea of the implementation, providing time complexity same(or better) as heaps?</p>