Best Operation
As stated earlier, the "best" element is always at the root of a binary heap implementation of PriorityQueue ADT.
Therefore best()
is $O(1)$ operation returning the value stored at root.
As stated earlier, the "best" element is always at the root of a binary heap implementation of PriorityQueue ADT.
Therefore best()
is $O(1)$ operation returning the value stored at root.