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 100 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 1,2,3,..n integers
Output Format:
Output of peek(), printWholeStack(), pop(), isFull(), and isEmpty() in a new line:
Example:
Input : 515123621044
Output:
44
441062123155
44
0// isFull() returns 1 if full, 0 otherwise
0// isEmpty() returns 1 if empty,0otherwise

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!