On 14/12/2023 10:55, Viktor Klang wrote:
I presume that the precondition to have the original collection be pre-ordered according to the supplied Comparator can be verified by checking before adding each element in the collection to the PQ that it compareTo equal-or-greater to the previous one?

It's not a precondition. If a PQ is created from an existing collection, or is deserialized (shudder!), then it has to copy and re-sort using the Comparator.

-Alan

Reply via email to