0% found this document useful (0 votes)
94 views1 page

Stack Operations and Applications Guide

The document describes a lab assignment involving operations on a stack using an array including push, pop, isEmpty, isFull, display, and peek. It also involves reversing a string, checking balanced parentheses, converting infix to postfix notation, and evaluating a postfix expression using a stack. Additional questions involve finding the nearest smaller element in an array and designing a stack that supports getMin in constant time and space.

Uploaded by

Kumar Shresth
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)
94 views1 page

Stack Operations and Applications Guide

The document describes a lab assignment involving operations on a stack using an array including push, pop, isEmpty, isFull, display, and peek. It also involves reversing a string, checking balanced parentheses, converting infix to postfix notation, and evaluating a postfix expression using a stack. Additional questions involve finding the nearest smaller element in an array and designing a stack that supports getMin in constant time and space.

Uploaded by

Kumar Shresth
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

Lab Assignment 3

Stack

1. Develop a menu driven program demonstrating the following operations on a Stack using array:
(i) push(), (ii) pop(), (iii) isEmpty(), (iv) isFull(), (v) display(), and (vi) peek().

2. Given a string, reverse it using STACK. For example “DataStructure” should be output as
“erutcurtSataD.”

3. Write a program that checks if an expression has balanced parentheses.

4. Write a program to convert an Infix expression into a Postfix expression.

5. Write a program for the evaluation of a Postfix expression.

Additional Questions:
 Given an array A, find the nearest smaller element for every element A[i] in the array such that
the element has an index smaller than i.
[Link]

 Design a stack that supports getMin() in O(1) time and O(1) extra space.
[Link]
space/

 [Link]

You might also like