时间:2021-07-01 10:21:17 帮助过:31人阅读
<?phpclass Deque {
private $queue = array(); public function addFirst($item) {
return array_unshift($this->queue, $item);
} public function addLast($item) {
return array_push($this->queue, $item);
} public function removeFirst() {
return array_shift($this->queue);
} public function removeLast() {
return array_pop($this->queue);
}
}相关推荐:
php实现双向队列的代码
关于双向队列的详细介绍
php 双向队列类
以上就是php代码实现双向队列的详细内容,更多请关注Gxl网其它相关文章!