SqArr=array();
$this->front=0;
$this->rear=0;
}
//销毁队列
public function DestroyQueue(){
$this->SqArr=null;
$this->front=0;
$this->rear=0;
}
//清空队列
public function ClearQueue(){
$this->SqArr=array();
$this->front=$this->rear=0;
}
//判断队列是否为空
public function QueueEmpty(){
if($this->front==$this->rear){
return 'Null';
}else{
return 'No Null';
}
}
//取得队头元素
public function GetHead(){
if($this->front == $this->rear){
return 'ERROR';
}
return $this->SqArr[$this->front];
}
//队列的长度
public function QueueLenghth(){
return $this->rear-$this->front;
}
//从队尾插入元素
public function EnQueue($elem){
$this->SqArr[$this->rear++]=$elem;
}
//从队头删除元素
public function DeQueue(){
if($this->front==$this->rear){
return 'ERROR';
}
unset($this->SqArr[$this->front]);
$this->front++;
return 'OK';
}
//遍历队列元素
public function QueueTraverse(){
$arr=array();
for($i=$this->front;$i<$this->rear;$i++){
$arr[]=$this->SqArr[$i];
}
return $arr;
}
}

售后响应及时
7×24小时客服热线
数据备份
更安全、更高效、更稳定
价格公道精准
项目经理精准报价不弄虚作假
合作无风险
重合同讲信誉,无效全额退款