Skip to content

Latest commit

 

History

History

stack

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Stack

Stack is a data structure that follows the Last In First Out (LIFO) principle (or First In Last Out, FILO), where the last element added to the stack is the first to be removed.

Stack Example

Operations

Push

When pushing an element to the stack, we add the element to the top of the stack.

Pop

When popping an element from the stack, we remove the top element from the stack

Time Complexity

Operation Average
Push O(1)
Pop O(1)