Stack Data Structure With Static Implementation -Ravi Kumar- 13001620175
The document provides an overview of the stack data structure, emphasizing its LIFO (Last In First Out) nature and key operations such as push and pop. It discusses two main implementations of stacks: using arrays and linked lists, detailing how elements are added and removed in each case. The document serves as an educational resource for understanding stack operations and their implementations in data structures.
Stack Data Structure With Static Implementation -Ravi Kumar- 13001620175
The document provides an overview of the stack data structure, emphasizing its LIFO (Last In First Out) nature and key operations such as push and pop. It discusses two main implementations of stacks: using arrays and linked lists, detailing how elements are added and removed in each case. The document serves as an educational resource for understanding stack operations and their implementations in data structures.
SUBJECT CODE : OE-EE-501A STUDENT NAME: Ravi Kumar UNIVERSITY ROLL: 13001620175 SEMESTER: 5th DEPARTMENT: EE
TECHNO MAIN SALTLAKE
INTRODUCTION Stack is a linear data structure that follows a particular order in which the operations are performed. The order may be LIFO(Last In First Out) or FILO(First In Last Out). This strategy states that the element that is inserted last will come out first. You can take a pile of plates kept on top of each other as a real-life example. The plate which we put last is on the top and since we remove the plate that is at the top, we can say that the plate that was put last comes out first. Some of its main operations are: push(), pop(), top(), Empty(), size(), etc. In order to make manipulations in a stack, there are certain operations provided to us. When we want to insert an element into the stack the operation is known as the push operation whereas when we want to remove an element from the stack the operation is known as the pop operation. If we try to pop from an empty stack then it is known as underflow and if we try to push an element in a stack that is already full, then it is known as overflow. Stack Representation in Data Structures Implementation of Stack in Data Structures You can perform the implementation of stacks in data structures using two data structures that are an array and a linked list. Array: In array implementation, the stack is formed using an array. All the operations are performed using arrays. You will see how all operations can be implemented on the stack in data structures using an array data structure. Linked-List: Every new element is inserted as a top element in the linked list implementation of stacks in data structures. That means every newly inserted element is pointed to the top. Whenever you want to remove an element from the stack, remove the node indicated by the top, by moving the top to its previous node in the list. REFERENCE : YouTube Geeksforgeeks Programiz Thank You