0% found this document useful (0 votes)
6 views2 pages

Stack Chapter Modern Notes

A Stack is a linear data structure that operates on the LIFO principle, allowing for basic operations like Push and Pop. It can be implemented using arrays or linked lists and has conditions such as Stack Overflow and Underflow. Stacks are commonly used in applications like reversing lists and converting expressions between different notations.

Uploaded by

farhanmulla965
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Stack Chapter Modern Notes

A Stack is a linear data structure that operates on the LIFO principle, allowing for basic operations like Push and Pop. It can be implemented using arrays or linked lists and has conditions such as Stack Overflow and Underflow. Stacks are commonly used in applications like reversing lists and converting expressions between different notations.

Uploaded by

farhanmulla965
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Stack Chapter - Modern Notes

1. Introduction to Stack:
- Definition: A Stack is a linear data structure that follows the LIFO (Last In, First Out) principle,

meaning the last element added is the first one to be removed.

- Stack as an ADT: A Stack is an Abstract Data Type (ADT) that supports basic operations such as

Push (insert) and Pop (remove). It is commonly used in algorithm design and problem-solving.

2. Operations on Stack:
- Push: Adds an element to the top of the stack.

- Pop: Removes and returns the top element of the stack.

3. Conditions:
- Stack Full/Stack Overflow: Occurs when attempting to push an element onto a stack that is already

at its maximum capacity.

- Stack Empty/Stack Underflow: Happens when attempting to pop an element from an empty stack.

4. Stack Implementation:
- Using Array: The stack is implemented using a fixed-size array, where a 'top' variable keeps track

of the top index.

- Using Linked List: Each node contains data and a reference to the next node. The 'top' points to

the latest node added.

5. Applications of Stack:
- Reversing a List: Elements of the list are pushed onto a stack and then popped to reverse the

order.

- Polish Notations: Used in evaluating and converting expressions between Prefix, Infix, and Postfix

notations.

- Conversion of Infix to Postfix Expression: Involves scanning the infix expression, using stack
operations to handle operators, and forming the postfix expression.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy