PriorityQueueTEnqueue Method |
Namespace: Ookii.Jumbo
PriorityQueueT accepts as a valid value for reference types and allows duplicate elements.
The new element's position is determined by the IComparableT implementation used to compare elements. If the new element is smaller than the current first element in the PriorityQueueT, the new element will become the first element in the queue. Otherwise, the existing first element will remain the first element.
If Count already equals Capacity, the capacity of the PriorityQueueT is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added.
If Count is less than Capacity, this method is an O(log n) operation, where n is Count. If the capacity needs to be increased to accommodate the new element, this method becomes an O(n log n) operation, where n is Count.