Class Stack
Class represeting LIFO data structure. The last element added to the stack
will be the first one to be removed.
-
BN\Collections\LinearDataStructure
-
BN\Collections\Stack
Methods summary
public
|
#
push( mixed $element )
Inserts element to the beggining of the stack
Inserts element to the beggining of the stack
Parameters
Throws
|
public
mixed
|
#
pop( )
Removes and returns first element of the stack. Returns null if the stack is
empty
Removes and returns first element of the stack. Returns null if the stack is
empty
Returns
mixed
|
public
mixed
|
#
peek( )
Returns first element of the stack (element is not removed from the stack).
Returns null if the stack is empty
Returns first element of the stack (element is not removed from the stack).
Returns null if the stack is empty
Returns
mixed
|