The number of elements that can be stored in the array or in the heap is called capacity. The capacity of the heap is always the capacity of the array minus one. The initial capacity of the array is the public constant defaultInitialCapacity (or the capacity specified in the constructor); the maximum capacity of the array is 2^30. The capacity of the array is doubled when needed. The load factor of the array is the ratio of the number of elements stored in the array to the capacity of the array. If array-shrinking is specified at construction time, the capacity of the array is halved when the load factor of the array is less than or equal to 0.25.
A binary heap such as this one has O(log n) insert, remove, and replaceKey, and O(1) min.
Internal ordering is maintained according to the order of the given Comparator. Of the Comparator methods, only compare(.)
is used.
@version JDSL 2.1.1
@author Mark Handy (mdh)
@author Benoit Hudson (bh)
@author Luca Vismara (lv)
@see Comparator
|
|
|
|