diff --git a/hwe/queue.php b/hwe/queue.php deleted file mode 100644 index 210bc0f8..00000000 --- a/hwe/queue.php +++ /dev/null @@ -1,43 +0,0 @@ -capacity = $capacity; - $this->size = 0; - $this->head = 0; - $this->tail = 0; - } - - function getSize() { - return $this->size; - } - - function clear() { - $this->size = 0; - $this->head = 0; - $this->tail = 0; - } - - function push($value) { - if($this->size >= $this->capacity) return; - $this->arr[$this->tail] = $value; - $this->tail = ($this->tail + 1) % $this->capacity; - $this->size++; - } - - function pop() { - if($this->size <= 0) return null; - $value = $this->arr[$this->head]; - $this->head = ($this->head + 1) % $this->capacity; - $this->size--; - return $value; - } -}