Question: Write a program to perform the basic operations of a stack such as push ( ) , pop ( ) , peek ( ) ,
Write a program to perform the basic operations of a stack such as push pop peek isFull isEmpty Assume stack is of size integers. The program should take input of a given n number of integers and push them into the stack and then perform the operations in the order mentioned below.
Input Format:
N n integers
Output Format:
Output of peek printWholeStack pop isFull and isEmpty in a new line:
Example:
Input :
Output:
isFull returns if full, otherwise
isEmpty returns if empty,otherwise
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
