Consider the situation that you have a shelf with 10 compartments and you have to place 11 books in it with each book occupying a compartment. You can only place 10 books in the shelf and for placing the 11th book, you need to find another shelf. Similarly multiple stack in data structure refers to the usage of more than one stack to store data. The same stack can be divided into two: one proceeding from 0 to max whereas the other proceeding from max to 0. When both stacks meets together, the stacks are full.
Chat with our AI personalities
A stack created by the user or a programmer is an implicit stack
A stack is a data structure in which last item inserted is taken out first . That's why they are known as LIFO (last in first out). Inserting an item in stack is termed as push and taking an item out from stack I s termed as pop. Stack pointer is the pointer that points to the top of the stack or that points the item at the top of the stack and help in adding or deleting the item from the top of stack.
A stack is a data structure in which last item inserted is taken out first . That's why they are known as LIFO (last in first out). Inserting an item in stack is termed as push and taking an item out from stack I s termed as pop. Stack pointer is the pointer that points to the top of the stack or that points the item at the top of the stack and help in adding or deleting the item from the top of stack.
Stack
top pointer of a stack is the pointer that refers to the top most element of the stack.