2013年12月15日

算法:基于 RingBuffer 的 Queue 实现《续》

摘要: 背景上篇实现了一个简单的队列,内部使用了 _count 计数,本文采用另外一种模式,不用 _count 计数。RingBuffer不用 _count 计数的话,为了区分队列的满和空,需要在数组中预留一格,如下图就代表了一个满队列。ArrayQueue代码 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 6 7 namespace DataStuctureStudy.Queues 8 { 9 . 阅读全文

posted @ 2013-12-15 11:29 幸福框架 阅读(1057) 评论(0) 推荐(0) 编辑

导航

我要啦免费统计