二元式队列。
TwoItemQueue.java:
package per.eyuan.util;
public class TwoItemQueue {
private TwoItem tiq[]=new TwoItem[20];
private int head;//队首
private int tail;//队尾
public TwoItemQueue() {
super();
init();
}
public void init(){
for(int i=0;i<tiq.length;i++){
tiq[i]=new TwoItem();
}
head=tail=0;
}
//获取队长度
public int getLength(){
return tail-head;
}
//出队
//入队
//获取队中所有成员
}