.net框架-队列(Queue)

队列(Queue)

  队列代表一个先进先出的集合

  队列元素为Object类型

  .net框架提供Queue<T>泛型队列类

  入队(Enqueue)和出队(Dequeue)是对列的基本操作,入队入队尾,出队出队头。

  继承接口:IEnumerable,ICollections,ICloneable

 

常用方法和属性:

  void Enqueue(object obj)  //入队,入队尾

  object Dequeue()  //出队,出队头,并返回出队对象

  object Peek()  //查看队头元素

  bool Contains(object obj)  //是否包含元素obj

  void Clear()  //清除所有元素

  object[] ToArray()  //元素复制到新数组

 

参考:

  http://www.runoob.com/csharp/csharp-queue.html

  http://www.cnblogs.com/xqhppt/archive/2011/09/15/2178101.html

posted @ 2017-02-09 11:10  水手哥  阅读(1718)  评论(0编辑  收藏  举报