new queue
new a queue of type int
Queue<int> queue=new Queue<int> ();
methods and attributes
- Attribute Count, get the number of elements contained in Queue.
if(queue.Count==0)
- Remove all elements from the Queue
queue.Clear();
- Determine whether an element is in the queue
queue.Contains( 5);
- Remove and return the object at the head of the Queue
int number=queue.Dequeue()
- Add an object to the end of the Queue
queue.Enqueue( 5 );
- Copy Queue to a new array
public virtual object[] ToArray();
- Set the capacity to the actual number of elements in the Queue
queue.TrimToSize();