Implementation note: this implementation provides O(log(n)) time for
the enqueing and dequeing methods (offer, poll, remove() and add);
linear time for the remove(Object) and contains(Object) methods; and
constant time for the retrieval methods (peek, element, and size).
# 1 楼答案
PriorityQueue有以下主要方法:
其中n表示队列中的元素数
# 2 楼答案
然后读the documentation: