I've tried looking at many websites, such as:
Java PriorityQueue with fixed size
but they don't seem to answer my question.
More specifically, I'm trying to implement a custom Priority Queue where I can only have a zero/1 argument constructor that can be either zero
/capacity
/p-queue
object. Is this possible considering the thread
talks about a 2-arg constructor (capacity
, comparator
)?
Added: Are the values of P-Queue always stored and retrieved as a binary tree? Wouldn't they always be sorted already then? e.g. [5, 6, 6, 64, 9]