-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBase.php
More file actions
36 lines (29 loc) · 852 Bytes
/
Base.php
File metadata and controls
36 lines (29 loc) · 852 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
namespace Zubs\Dsa\Stack;
use Zubs\Dsa\LinkedList\Base as LinkedList;
abstract class Base
{
protected int $limit;
protected LinkedList | array $stack = [];
/**
* Add new item to the end of stack
* @param string $data String data to be added to stack
* @return bool true when the function completes
*/
abstract public function push (string $data): bool;
/**
* Remove last item in array
* @return string String data removed from array
*/
abstract public function pop(): string;
/**
* Get the last item in the stack
* @return string String data at the end of the stack
*/
abstract public function top(): string;
/**
* Check if the stack is empty
* @return bool true when the stack is empty
*/
abstract public function isEmpty(): bool;
}