2011年3月23日

悲剧了(愈发的感觉 数据结构的重要性,一定要把数据结构的思想整明白)

摘要: 这两天看了看池,循环队列没好好学习,算是重新来过了protected int _next;protected int _oldest;关于队列满的情况判断,所以队列中只能存储size-1个值,如果使用return (_next) % _size == _oldest;的话,初始就full了,而用next+1的话,最后一个位置就不能够填上,等到oldest改变(即池中的数据取出之后才开始继续填充)package tests;public class SyncQueue { protected Object[] _array; protected int _next; protected int 阅读全文

posted @ 2011-03-23 10:14 songqiuming 阅读(158) 评论(0) 推荐(0) 编辑

导航