Learn more about Stacks
Here we have already gained the basic information on stacks , click on the below button to learn about more operations that can be performed on stack
Stack is one of the basic linear Data structure, that we use for storing our data. Data in a stack is stored in a serialized manner. One important thing about using a Stack is that the data first entered in the stack will be at the last of the stack. This is one of the reason why we also called Stack a LIFO Data Structure, i.e; Last in First Out. We’ll be discussing more about this feature later in this article.
Before we move on further with understanding the Stack Data Structure, we need to learn about the basic terminology that is associated with this data structure so that understanding stack will be a little easy for us.
The basic terminology that we will be using in Stack is :
A stack may be implemented to have a bounded capacity. If the stack is full and does not contain enough space for push operation, the stack is then considered to be in an overflow state.
Below is simple representation of a stack with push and pop operations –
O(1)
O(n)
O(n)
O(1)
(n+1)/2
There a lot of places where we use stack without even realizing it. Let’s see some of the most common uses of stack data structure.
Here we have already gained the basic information on stacks , click on the below button to learn about more operations that can be performed on stack
Login/Signup to comment