Skip to content

Tag Archives: PHP-ds_stack

The Ds\Stack::count() function is an inbuilt function in PHP which is used to count the number of elements present in the Stack. Syntax: int Ds\Stack::count(… Read More
The Ds\Stack::allocate() function is an inbuilt function in PHP which is used to allocate memory for required capacity. This function allocates sufficient memory for a… Read More
The Ds\Stack::__construct() function is an inbuilt function in PHP which is used to create a new instance of stack. Syntax: public Ds\Stack::__construct( $values ) Parameters:… Read More
The Ds\Stack::capacity() function is an inbuilt function in PHP which is used to return the current capacity of the stack. Syntax: int Ds\Stack::capacity( void )… Read More
Stack is a linear data structure which follows a particular order in which the operations are performed. The order may be LIFO(Last In First Out)… Read More
The Ds\Stack::isEmpty() function of PHP Ds\Stack class is used to check whether a Stack is empty or not. This method returns a boolean value, True… Read More
The Ds\Stack::clear() function of PHP is used to remove all elements from a Stack and clear it. This function simply removes all of the elements… Read More
The Ds\Stack::toArray() function of PHP is used to convert the stack to an array and returns the converted array. This function does not modify the… Read More
The Ds\Stack::pop() function of PHP is used to remove the element present at the top of the Stack instance. This function also returns the top… Read More
The Ds\Stack::push() function of PHP is used to add elements at the end of the stack. That it is used to push elements on to… Read More
The Ds\Stack::copy() function of PHP Ds\Stack class is used to create a shallow copy of the original stack and returns the copied stack. Syntax:   Ds\Stack… Read More
The Ds\Stack::peek() function of PHP is used to get the element present at the top of the Stack instance. This function just returns the top… Read More