Do I understand correctly that in Java as data structures PriorityQueue uses a binary heap, and specifically the implementation of max-heap?
Judging by the description siftUp method inside the class:
Inserts item x at position k, maintaining heap invariant by promoting x up the tree until it is greater than or equal to its parent or is the root.
Ie is concerned with the promotion of the added item to the top of the tree until it is greater than or equal to its parent, and if so, then sitting in the root of the maximum element?
The head of the queue is the smallest element.
The items are ordered and depending on the comparator, I.e. not only the standard order.
The implementation is based on #the heap# and repository is actually an array.