Queue.Count 속성
정의
public:
virtual property int Count { int get(); };
public virtual int Count { get; }
member this.Count : int
Public Overridable ReadOnly Property Count As Integer
속성 값
Queue에 있는 요소의 개수입니다.The number of elements contained in the Queue.
구현
설명
Queue 용량은 Queue에서 저장할 수 있는 요소 수입니다.The capacity of a Queue is the number of elements that the Queue can store. Count 에 실제로 있는 요소의 수는 Queue합니다.Count is the number of elements that are actually in the Queue.
Queue 용량은 항상 Count보다 크거나 같아야 합니다.The capacity of a Queue is always greater than or equal to Count. 요소를 추가 하는 동안 Count 용량을 초과 하는 경우 이전 요소를 복사 하 고 새 요소를 추가 하기 전에 내부 배열을 다시 할당 하 여 용량이 자동으로 늘어납니다.If Count exceeds the capacity while adding elements, the capacity is automatically increased by reallocating the internal array before copying the old elements and adding the new elements. 새 용량은 현재 용량에 증가 비율을 곱하여 결정 됩니다 .이는 Queue 생성 될 때 결정 됩니다.The new capacity is determined by multiplying the current capacity by the growth factor, which is determined when the Queue is constructed. 증가 비율에 관계 없이 Queue 용량은 항상 최소값으로 증가 합니다. 1.0의 증가율은 Queue 크기가 증가 하는 것을 방지 하지 않습니다.The capacity of the Queue will always increase by a minimum value, regardless of the growth factor; a growth factor of 1.0 will not prevent the Queue from increasing in size.
TrimToSize를 호출 하 여 용량을 줄일 수 있습니다.The capacity can be decreased by calling TrimToSize.
이 속성의 값을 검색 하는 작업은 O(1)입니다.Retrieving the value of this property is an O(1) operation.