Click or drag to resize

PriorityQueueTCapacity Property

Gets or sets the total number of elements the internal data structure can hold without resizing.

Namespace:  Ookii.Jumbo
Assembly:  Ookii.Jumbo (in Ookii.Jumbo.dll) Version: 2.0.0
Syntax
public int Capacity { get; set; }

Property Value

Type: Int32
The number of elements that the PriorityQueueT can contain before resizing is required.
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptionCapacity is set to a value that is less than count.
Remarks

Capacity is the number of elements that the PriorityQueueT can store before resizing is required, while Count is the number of elements that are actually in the PriorityQueueT.

Capacity is always greater than or equal to Count. If Count exceeds Capacity while adding elements, the capacity is increased by automatically reallocating the internal array before copying the old elements and adding the new elements.

The capacity can be decreased by setting the Capacity property explicitly. When the value of Capacity is set explicitly, the internal array is also reallocated to accommodate the specified capacity, and all the elements are copied.

Retrieving the value of this property is an O(1) operation; setting the property is an O(n) operation, where n is the new capacity.

See Also