PriorityQueue:
1、构造函数:无参数:默认参数大小为11
public PriorityQueue() {
this(DEFAULT_INITIAL_CAPACITY, null);
}
有参数:用户可自定义大小
public PriorityQueue(int initialCapacity) {
this(initialCapacity, null);
}
2:扩容方式:
private void grow(int minCapacity) {
int oldCapacity = queue.length;
// Double size if small; else grow by 50%
int newCapacity = oldCapacity + ((oldCapacity < 64) ?
(oldCapacity + 2) :
(oldCapacity >> 1));
// overflow-conscious code
if (newCapacity - MAX_ARR