时间:2021-07-01 10:21:17 帮助过:2人阅读
<?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网其它相关文章!