Stack MCQ : Basics of Stack ( Multiple Choice Questions)


Question 1
User perform following operations on stack of size 5 then -
push(1);
pop();
push(2);
push(3);
pop();
push(4);
pop();
pop();
push(5);
at the end of last operation, total number of elements present in the stack are -
A
3
B
1
C
2
D
4
Question 2
In order to keep track of current topmost element of the stack we need to maintain one variable.
A
False
B
True
Question 3
Consider Stack is implemented using the array.
#define MAX 10
struct STACK
{
int arr[MAX]
int top = ___________;
}
What will be the initial value with which top is initialized.
A
Garbage
B
1
C
0
D
-1
Question 4
Consider Stack is implemented using the array.
#define MAX 10
struct STACK
{
int arr[MAX]
int top = -1;
}
In this implementation of stack maximum value of top which cannot cause overflow will _________.
A
11
B
9
C
10
D
Any Other
Question 5
User perform following operations on stack of size 5 then -
push(1);
pop();
push(2);
push(3);
pop();
push(2);
pop();
pop();
push(4);
pop();
pop();
push(5);
Which of the following is correct statement for stack ?
A
Overflow Occures
B
Underflow Occures
C
Stack Operations will be performed Smoothly
D
None of these
Question 5 Explanation: 
Before Pushing 4 we have only 1 element in the stack. We are popping 2 elements from the stack thus underflow of stack occurs.
There are 5 questions to complete.