Stack Operations - Section 3 Multiple Questions and Answers.




26.When does top value of the stack changes?
A. Before deletion
B. While checking underflow
C. At the time of deletion
D. After deletion

27.The process of accessing data stored in a serial access memory is similar to manipulating data on a:
A. stack
B. binary tree
C. heap
D. queue

28.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. 4
C. 2
D. 1

29.Consider Stack is implemented using the array. What will be the initial value with which top is initialized:
#define MAX 10
struct STACK
{
int arr[MAX]
int top = ___________;
}
A. 0
B. -1
C. Garbage
D. 1

30.Consider Stack is implemented using the array. In this implementation of stack maximum value of top which cannot cause overflow will _________.
#define MAX 10
struct STACK
{
int arr[MAX]
int top = -1;
}
A. 9
B. 10
C. 11
D. AnyOther

«»



Date to Date Current Affairs 2022

PakMCQs.net

Quick Links

GAT Subject



   Computer Science    English Mcqs    Agriculture    

Engineering



   Computer Science    Civil Engineering    

Technical



   Networking    Electronics    Database    

Past Papers



   Model Papers    FPSC Papers