Refer to CUET Computer Science MCQs Chapter 2 Stack provided below available for download in Pdf. The MCQ Questions for UG Computer Science with answers are aligned as per the latest syllabus and exam pattern suggested by CUET, NCERT and KVS. Multiple Choice Questions for Chapter 2 Stack are an important part of exams for UG Computer Science and if practiced properly can help you to improve your understanding and get higher marks. Refer to more Chapter-wise MCQs for CUET UG Computer Science and also download more latest study material for all subjects
MCQ for UG Computer Science Chapter 2 Stack
UG Computer Science students should refer to the following multiple-choice questions with answers for Chapter 2 Stack in UG.
Chapter 2 Stack MCQ Questions UG Computer Science with Answers
Question. The following postfix expression with single digit operands is evaluated using a stack:
8 2 3 ^ / 2 3 * + 5 1 * -
Note that ^ is the exponentiation operator. The top two elements of the stack after the first * is evaluated are:
a) 6, 1
b) 5, 7
c) 3, 2
d) 1, 5
Answer : A
Question. Which is true for "x in y" membership operator expression used in Python?
a) Returns true if a sequence with the specified value is not present in the object
b) Returns true if both variables are not the same object
c) Returns true if both variables are the same object
d) Returns true if a sequence with the specified value is present in the object
e) None of the above
Answer : D
Question. Which of the following statements are correct for Queue?
A. Queue is an ordered linear data structure
B. Deque can support both stack and queue operations
C. Queue is a non-linear data structure
D. Queue works on FILO principle
E. Deque is a version of Queue which does not allow insertion and deletion at both ends
Choose the correct answer from the options given below:
a) A and C only
b) A and B only
c) B and C only
d) A, B and E only
Answer : B
Question. Stack A has the entries a, b, and c (with a on top). Stack B is empty. An entry popped out of stack A can be printed immediately or pushed to stack B. An entry popped out of stack B can only be printed. In this arrangement, Which of the following permutations of a, b, and c are not possible?
a) b a c
b) c b a
c) c a b
d) a b c
Answer : C
Question. The method provided by Python to insert elements into a stack is:
a) append()
b) insert()
c) push()
d) add()
Answer : A
Question. A stack is a linear data structure in which data is stored and retrieved in a:
a) Last Out First In (LOFI)
b) Last In First Out (LIFO)
c) First In First Out (FIFO)
d) Last Out Last In (LOLI)
e) None of the above
Answer : B
Question. What is the output of the program for the following input ? 5 2 * 3 3 2 + * +
a) 15
b) 25
c) 30
d) 150
Answer : B
Question. A priority queue Q is used to implement a stack S that stores characters. PUSH(C) is implemented as INSERT(Q, C, K) where K is an appropriate integer key chosen by the implementation. POP is implemented as DELETEMIN(Q). For a sequence of operations, the keys chosen are in
a) Non-increasing order
b) Non-decreasing order
c) strictly increasing order
d) strictly decreasing order
Answer : D
Question. If the sequence of operations - push (1), push (2), pop, push (1), push (2), pop, pop, pop, push (2), pop are performed on a stack, the sequence of popped out values
a) 2,2,1,1,2
b) 2,2,1,2,2
c) 2,1,2,2,1
d) 2,1,2,2,2
Answer : A
Question. In which type of expression the operators are placed after the corresponding operands?
a) Infix
b) Postfix
c) Prefix
d) More than one of the above
e) None of the above
Answer : B
Question. Which of the following is not an inherent application of stack?
a) Implementation of recursion
b) Evaluation of a postfix expression
c) Job scheduling
d) Reverse a string
Answer : C
Question. Consider the following sequence of operations on an empty stack.
Push(54);push(52);pop();push(55);push(62);s=pop();
Consider the following sequence of operations on an empty queue.
enqueue(21);enqueue(24);dequeue();enqueue(28);enqueue(32);q=dequeue();
The value of s+q is ___________.
a) 86
b) 68
c) 24
d) 94
Answer : A
Question. 7 9 3 + 4 / *
The evaluation of the above postfix expression is:
a) 10
b) 49
c) 9
d) 21
Answer : D
Question. Which of the following option has linear data structure?
a) Turnery Tree
b) binary Tree
c) Stack
d) More than one of the above
e) None of the above
Answer : C
Question. When a * b is written as *ab, it is called:
a) Postfix expression
b) Reverse polish notation
c) Polish notation
d) Infix expression
Answer : C
Question. Consider the following statements:
i. First-in-first out types of computations are efficiently supported by STACKS.
ii. Implementing LISTS on linked lists is more efficient than implementing LISTS on an array for almost all the basic LIST operations.
iii. Implementing QUEUES on a circular array is more efficient than implementing QUEUES on a linear array with two indices.
iv. Last-in-first-out type of computations are efficiently supported by QUEUES.
Which of the following is correct?
a) (ii) is true
b) (i) and (ii) are true
c) (iii) is true
d) (ii) and (iv) are true
Answer : C
Question. Which type of data structure stack is it?
a) Linear
b) Non-Linear
c) Nonconsecutive
d) None of these
Answer : A
Question. What is the postfix representation of the following infix expression?
a) (A + B) * C – D * E / F
b) A B + C * D E * F - /
c) A B * C + D E * F / -
d) A B + C – D E * F / *
e) A B + C * D E * F / -
Answer : D
Question. Trying to add an element to a full stack results in an exception called ____________.
a) overflow
b) inflow
c) outflow
d) underflow
Answer : A
Question. Consider n elements that are equally distributed in k stacks. In each stack, elements of it are arranged in ascending order (min is at the top in each of the stack and then increasing downwards). Given a queue of size n in which we have to put all n elements in increasing order. What will be the time complexity of the best known algorithm?
a) O(n logk)
b) O(nk)
c) O(n2)
d) O(k2)
Answer : A
Question. Which of the following is true about linked list implementation of stack?
a) In push operation, if new nodes are inserted at the beginning of linked list, then in pop operation, nodes must be removed from end.
b) In push operation, if new nodes are inserted at the end, then in pop operation, nodes must be removed from the beginning.
c) Both of the above
d) None of the above
Answer : D
Question. What is the outcome of the prefix expression +, -, *, 3, 2, /, 8, 4, 1?
a) 12
b) 5
c) 11
d) 4
Answer : B
Question. Assume that the operators +, -, × are left associative and ^ is right associative. The order of precedence (from highest to lowest) is ^, x , +, -. The postfix expression corresponding to the infix expression a + b × c - d ^ e ^ f is
a) abc × + def ^ ^ -
b) abc × + de ^ f ^ -
c) ab + c × d - e ^ f ^
d) - + a × bc ^ ^ def
Answer : A
Question. Which of the following permutation can be obtained in the same order using a stack assuming that input is the sequence 5, 6, 7, 8, 9 in that order?
a) 7, 8, 9, 5, 6
b) 5, 9, 6, 7, 8
c) 7, 8, 9, 6, 5
d) 9, 8, 7, 5, 6
Answer : C
Question. A ____________ notation is used for writing an expression in which binary operators are written in between the operands.
a) Infix
b) Prefix
c) Postfix
d) Non of the above
Answer : A
Question. Consider the following operations performed on a stack of size 5 : Push (a); Pop() ; Push(b); Push(c); Pop(); Push(d); Pop();Pop(); Push (e) Which of the following statements is correct?
a) Underflow occurs
b) Stack operations are performed smoothly
c) Overflow occurs
d) None of the above
Answer : B
Question. The result evaluating the postfix expression 10 5 + 60 6 / * 8 − is
a) 284
b) 213
c) 142
d) 71
Answer : C
Question. What is the value after evaluation of the following expression?
78+52-*
a) 12
b) 85
c) 25
d) 45
Answer : D
Question. Stack A has the entries a, b, c (with a on top). Stack B is empty. An entry popped out of stack A can be printed immediately or pushed to stack B. An entry popped out of the stack B can be only be printed. In this arrangement, which of the following permutations of a, b, c are not possible?
a) b a c
b) b c a
c) c a b
d) a b c
Answer : C
Question. Let S be a stack of size n >= 1. Starting with the empty stack, suppose we push the first n natural numbers in sequence, and then perform n pop operations. Assume that Push and Pop operation take X seconds each, and Y seconds elapse between the end of one such stack operation and the start of the next operation. For m >= 1, define the stack-life of m as the time elapsed from the end of Push(m) to the start of the pop operation that removes m from S. The average stack-life of an element of this stack is
a) n(X+ Y)
b) 3Y + 2X
c) n(X + Y)-X
d) Y + 2X
Answer : C
Question. The five items P,Q,R,S and T are pushed in a stack, one after the other starting from P. The stack is popped four times and each element is inserted in a queue. Then two elements are deleted from the queue and pushed back on the stack. now one item is popped from the stack. The popped item is:
a) P
b) R
c) Q
d) S
Answer : D
Question. Two fundamental operations performed on the stack are ________________.
a) BACK & FRONT
b) TOP & HEAD
c) ENQUEUE & DEQUEUE
d) PUSH & POP
Answer : D
Question. Suppose a stack is to be implemented with a linked list instead of an array. What would be the effect on the time complexity of the push and pop operations of the stack implemented using linked list (Assuming stack is implemented efficiently)?
a) O(1) for insertion and O(n) for deletion
b) O(1) for insertion and O(1) for deletion
c) O(n) for insertion and O(1) for deletion
d) O(n) for insertion and O(n) for deletion
Answer : B
Question. When a * b is written as *ab, it is called:
a) Postfix expression
b) Reverse polish notation
c) Polish notation
d) Infix expression
Answer : C
Question. The seven elements A, B, C, D, E, F and G are pushed onto a stack in reverse order, i.e., starting from G. The stack is popped five times and each element is inserted into a queue.Two elements are deleted from the queue and pushed back onto the stack. Now, one element is popped from the stack. The popped item is ________.
a) A
b) B
c) F
d) G
Answer : B
Question. Consider the following postfix expression with single digit operands:
6 2 3 * / 4 2 * + 6 8 * -
The top two elements of the stack after second * is evaluated, are:
a) 6, 3
b) 8, 1
c) 8, 2
d) 6, 2
Answer : B
Question. In python, which data structure is preferred over a list when there is a need for quicker append and pop operations from both the ends of the container?
a) deque
b) stack
c) queue
d) None of the above
Answer : A
Question. Which one of the following is an application of Stack Data Structure?
a) Managing function calls
b) The stock span problem
c) Arithmetic expression evaluation
d) All of the above
Answer : D
Question. Which of the following operation will be performed by pops function on stack "stackname" in the following code?
def pops(stackname):
return len(stackname)
a) Read top most element of the stack.
b) Pop element from the stack.
c) Push element on to the top of stack.
d) Returns the size of stack.
Answer : D
Question. The five items: A, B, C, D, and E are pushed in a stack, one after other starting from A. The stack is popped four items and each element is inserted in a queue. The two elements are deleted from the queue and pushed back on the stack. Now one item is popped from the stack. The popped item is
a) A
b) B
c) C
d) D
Answer : D
Question. A stack can be implemented using queue, but then we need to use atleast:
a) 3 queues
b) 2 queues
c) only one queue is sufficient
d) none of the options
Answer : B
Question. To evaluate an expression without any embedded function calls :
a) As many stacks as the height of the expression tree are needed
b) One stack is enough
c) Two stacks are needed
d) A Turing machine is needed in the general case
Answer : B
Question. While conversion of an Infix notation to its equivalent Prefix/Postfix notation, only ______________ are PUSHED onto the Stack.
a) operands
b) symbols
c) operators
d) None of the above
Answer : C
Question. The best data structure to check whether an arithmetic expression has balanced parenthesis is a
a) Queue
b) Stack
c) Tree
d) List
Answer : B
Question. What would be the prefix notation for the given equation?
(a+(b/c) *(d^e)-f)
a) -+fa*/bc^de
b) -+a*b/c^def
c) +-a*/^bcdef
d) -+a*/bc^def
Answer : D
Question. Elements “5”, “9”, “2” and “4” are placed in a queue and are deleted one at a time. In what order will they be removed?
a) 2495
b) 4295
c) 5942
d) 5924
Answer : D
Question. Convert the following infix expression into its equivalent post fix expression (A + B^ D) / (E – F) + G
a) ABD^ + EF – / G+
b) ABD + ^EF – / G+
c) ABD + ^EF / – G+
d) ABD^ + EF / – G+
Answer : A
Question. Which of the following is true about linked list implementation of stack?
a) In push operation, if new nodes are inserted at the beginning of linked list, then in pop operation, nodes must be removed from end.
b) In push operation, if new nodes are inserted at the end, then in pop operation, nodes must be removed from the beginning.
c) Both of the above
d) None of the above
Answer : D
Question. The result evaluating the postfix expression 10 5 + 60 6 / * 8 – is
a) 284
b) 213
c) 142
d) 71
Answer : C
Question. Consider the following stack implemented using stack -
# define SIZE 11
Struct STACK
{
int arr [SIZE];
int top = -1;
}
What would be the maximum value of the top that does not cause the overflow of the stack?
a) 9
b) 8
c) 11
d) 10
Answer : D
Question. The five items: A, B, C, D, and E are pushed in a stack, one after other starting from A. The stack is popped four items and each element is inserted in a queue. The two elements are deleted from the queue and pushed back on the stack. Now one item is popped from the stack. The popped item is
a) A
b) B
c) C
d) D
Answer : D
Question. The five items: A, B, C, D, and E are pushed in a stack, one after other starting from A. The stack is popped four items and each element is inserted in a queue. The two elements are deleted from the queue and pushed back on the stack. Now one item is popped from the stack. The popped item is
a) A
b) B
c) C
d) D
Answer : D
Question. A single array A[1..MAXSIZE] is used to implement two stacks. The two stacks grow from opposite ends of the array. Variables top1 and top2 (topl< top 2) point to the location of the topmost element in each of the stacks. If the space is to be used efficiently, the condition for “stack full” is
a) (top1 = MAXSIZE/2) and (top2 = MAXSIZE/2+1)
b) top1 + top2 = MAXSIZE
c) (top1= MAXSIZE/2) or (top2 = MAXSIZE)
d) top1= top2 -1
Answer : D
Question. A function f defined on stacks of integers satisfies the following properties. f(∅) = 0 and f (push (S, i)) = max (f(S), 0) + i for all stacks S and integers i.
If a stack S contains the integers 2, -3, 2, -1, 2 in order from bottom to top, what is f(S)?
a) 6
b) 4
c) 3
d) 2
Answer : C
Question. A recursive problem like tower of hanoi can be rewritten without recursion using:
a) stack
b) priority queue
c) graph
d) cycles
Answer : A
CUET Computer Science MCQs Chapter 1 Database Query using SQL |
CUET Computer Science MCQs Chapter 1 Exception and File Handling in Python |
CUET Computer Science MCQs Chapter 2 Stack |
CUET Computer Science MCQs Chapter 3 Queue |
CUET Computer Science MCQs Chapter 4 Searching |
CUET Computer Science MCQs Chapter 5 Sorting |
CUET Computer Science MCQs Chapter 6 Understanding Data |
CUET Computer Science MCQs Chapter 7 Database Concepts |
CUET Computer Science MCQs Chapter 8 Structured Query Language |
CUET Computer Science MCQs Chapter 9 Computer Networks |
MCQs for Chapter 2 Stack Computer Science UG
Expert teachers of studiestoday have referred to NCERT book for UG Computer Science to develop the Computer Science UG MCQs. If you download MCQs with answers for the above chapter you will get higher and better marks in UG test and exams in the current year as you will be able to have stronger understanding of all concepts. Daily Multiple Choice Questions practice of Computer Science will help students to have stronger understanding of all concepts and also make them expert on all critical topics. After solving the questions given in the MCQs which have been developed as per latest books also refer to the NCERT solutions for UG Computer Science. We have also provided lot of MCQ questions for UG Computer Science so that you can solve questions relating to all topics given in each chapter. After solving these you should also refer to UG Computer Science MCQ Test for the same chapter.
You can download the CUET MCQs for UG Computer Science Chapter 2 Stack for latest session from StudiesToday.com
Yes, the MCQs issued by CUET for UG Computer Science Chapter 2 Stack have been made available here for latest academic session
You can find CUET UG Computer Science Chapter 2 Stack MCQs on educational websites like studiestoday.com, online tutoring platforms, and in sample question papers provided on this website.
To prepare for Chapter 2 Stack MCQs, refer to the concepts links provided by our teachers and download sample papers for free.
Yes, there are many online resources that we have provided on studiestoday.com available such as practice worksheets, question papers, and online tests for learning MCQs for UG Computer Science Chapter 2 Stack