filmov
tv
What is Stack Data Structure ? | Data Structure and Algorithms (DSA) | Part - 1

Показать описание
Understand the working of Stack Data structure. Stack is a linear data structure which operates in a LIFO(Last In First Out) or
FILO (First In Last Out) pattern.
It is named stack as it behaves like a real-world stack, for example – a deck of cards or a pile of plates, etc.
Stack is an abstract data type with a bounded (predefined) capacity.
It is a simple data structure that allows adding and removing elements in a particular order.
The order may be LIFO(Last In First Out) or FILO(First In Last Out).
Standard Stack Operations -
1) push() -
Place an item onto the stack. If there is no place for new item, stack is in overflow state.
2) pop() -
Return the item at the top of the stack and then remove it. If pop is called when stack is empty, it is in an underflow state.
3) isEmpty() -
Tells if the stack is empty or not
4) isfull() -
Tells if the stack is full or not.
5) peek() -
Access the item at the i position
6) count() -
Get the number of items in the stack.
7) change() -
Change the item at the i position
8) display() -
Display all items in the stack
---------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
Support Simple Snippets by Donations -
---------------------------------------------------------------------------------------------
Simple Snippets Official Website -
Simple Snippets on Facebook -
Simple Snippets on Instagram -
Simple Snippets on Twitter -
Simple Snippets Google Plus Page -
Simple Snippets email ID -
#stack #datastructure #stackdatastructure #stackoperations
FILO (First In Last Out) pattern.
It is named stack as it behaves like a real-world stack, for example – a deck of cards or a pile of plates, etc.
Stack is an abstract data type with a bounded (predefined) capacity.
It is a simple data structure that allows adding and removing elements in a particular order.
The order may be LIFO(Last In First Out) or FILO(First In Last Out).
Standard Stack Operations -
1) push() -
Place an item onto the stack. If there is no place for new item, stack is in overflow state.
2) pop() -
Return the item at the top of the stack and then remove it. If pop is called when stack is empty, it is in an underflow state.
3) isEmpty() -
Tells if the stack is empty or not
4) isfull() -
Tells if the stack is full or not.
5) peek() -
Access the item at the i position
6) count() -
Get the number of items in the stack.
7) change() -
Change the item at the i position
8) display() -
Display all items in the stack
---------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
Support Simple Snippets by Donations -
---------------------------------------------------------------------------------------------
Simple Snippets Official Website -
Simple Snippets on Facebook -
Simple Snippets on Instagram -
Simple Snippets on Twitter -
Simple Snippets Google Plus Page -
Simple Snippets email ID -
#stack #datastructure #stackdatastructure #stackoperations
Комментарии