<?php
class Queue {
public $number = array();
public $index = -1;
public function is_empty(){
if($this->index == -1){
return true;
}
return false;
}
public function push($element)
{
$this->index++;
$this->number[$this->index] = $element;
}
public function pop_from_last(){
return array_shift($this->number);
}
}
$person = new Queue();
$person->push(2);
$person->push(4);
$person->push(8);
$person->push(9);
print_r($person->number);
echo '<br>';
echo $person->pop_from_last();
echo '<br>';
print_r($person->number);
class Queue {
public $number = array();
public $index = -1;
public function is_empty(){
if($this->index == -1){
return true;
}
return false;
}
public function push($element)
{
$this->index++;
$this->number[$this->index] = $element;
}
public function pop_from_last(){
return array_shift($this->number);
}
}
$person = new Queue();
$person->push(2);
$person->push(4);
$person->push(8);
$person->push(9);
print_r($person->number);
echo '<br>';
echo $person->pop_from_last();
echo '<br>';
print_r($person->number);
Best Casino Apps in Illinois (2021) - MapYRO
ReplyDeleteBest Casino 정읍 출장안마 Apps in Illinois (2021) In Illinois, one of the best 광양 출장안마 casinos 군산 출장안마 you'll find in Illinois 김포 출장마사지 is Mohegan Sun 서산 출장샵 Pocono.