In this article you will learn about stack data structure, what is a stack, what it’s application and how you can implement it.
Table of Contents
- what is data structures?
- what is stack?
- applications of stack
- implementation of stack data structure
What is data structures?
A data structure is a data organization, management, and storage format that enables efficient access and modification.
More precisely, a data structure is a collection of data values, the relationships among them, and the functions or operations that can be applied to the data.
What is Stack?
It is a simple data structure that allows adding and removing elements in a particular order. Every time an element is added, it goes on the top of the stack.
Stack is a LIFO(Last in First out) structure or we can say FILO(First in Last out).
Adding a new element onto the stack is called PUSH.
Removing an element from the stack is called POP.
Applications of stack
The simplest application of a stack is to reverse a word. You push a given word to stack and then pop letters from the stack.
Also stacks can be used to create undo-redo functionalities.
Implementation of Stack Data Structure
Stack can be implemented using an Array or a Linked List.
For more of these type of information, you can follow me on Twitter HamidAK
and on medium Hamid AK