Check the below NCERT MCQ Class 12 Computer Science Chapter 1 Data Structures with Answers available with PDF free download. MCQ Questions for Class 12 Computer Science with Answers were prepared based on the latest syllabus and examination pattern issued by CBSE, NCERT and KVS. Our teachers have provided below Data Structures Class 12 Computer Science MCQs Questions with answers which will help students to revise and get more marks in exams
Data Structures Class 12 Computer Science MCQ Questions with Answers
Refer below for MCQ Class 12 Computer Science Chapter 1 Data Structures with solutions. Solve questions and compare with the answers provided below
Question. Process of inserting an element in stack is called
Question. In a stack, if a user tries to remove an element from empty stack is called
(d) Garbage collection
Question. Which data structure is needed to convert infix notation to postfix notation?
Question. Pile of books is an example of ……… .
(d) linked list
Question. Which of the following is/are linear data structure(s)?
(d) All of these
Question. Integer, real, character, pointer and reference are ……… data structures.
Question. Process of removing an element from stack is called
Question. ………… of data structure means processing all thedata elements of it.
Question. Data structures are
(a) network structures
(b) group of data
(c) different types of data
(d) different operations on data
Question. Pushing an element into stack already having five elements and stack size of 5, then stack becomes
(b) Uses flow
Question. The prefix form of A-B/ (C * D ^ E) is
Question. The result of evaluating the postfix expression 5, 4, 6, +, *, 4, 9, 3, /, +, * is?
Question. Consider the following operation performed on a stack of size 5.
After the completion of all operation, the number of elements present in stack are
Question. Which of the following is not an inherent application of stack?
(A) Reversing a string
(B) Evaluation of postfix expression
(C) Implementation of recursion
(D) Job scheduling
Question. The postfix form of the expression (A+ B)*(C*DE)* F / G is?
(A) AB+ CD*E – FG /**
(B) AB + CD* E – F **G /
(C) AB + CD* E – *F *G /
(D) AB + CDE * – * F *G /
Question. The data structure required to check whether an expression contains balanced parenthesis is
Question. What data structure would you most likely see in a non recursive implementation of a recursive algorithm?
(A) Linked List
Question. The data structure required for Breadth First Traversal on a graph is
Question. Circular Queue is also known as _________
(A) Ring Buffer
(B) Square Buffer
(C) Rectangle Buffer
(D) Curve Buffer
Question. In a stack all deletions takes place at _______ end.
Question. When a stack is full and no element can be added, it is called an ________.
(C) Out of range
Assertion and Reason Based MCQs
Directions : In the following questions, A statement of Assertion (A) is followed by a statement of
Reason (R). Mark the correct choice as.
(A) Both A and R are true and R is the correct explanation for A.
(B) Both A and R are true and R is not correct explanation for A.
(C) A is true but R is false.
(D) A is false but R is true.
Question. Assertion (A): push (A) removes the element from stack
Reason (R): The time complexity of push () is O(1).
Question. Assertion (A): A data structure is a named group of data types.
Reason (R): A data structure has a well defined operations, behaviour and properties.
Question. Assertion (A): The postfix form of (A + B) * C is AB + C *.
Reason (R): Postfix notation refers to when operator is placed after its operands.
Question. Assertion (A): A stack is a linear data structure that stores items in First in first out.
Reason (R): New element is added at one end and an element is removed from that end only.
Question. Assertion (A): Simple data structures are built from primitive data types.
Reason (R): Stacks and queues are simple data structures.
Question. Assertion (A): The element in stack is removed from the top.
Reason (R): The process of removal is called POP.
Question. Assertion (A): An error occurs when one tries to delete an empty stack.
Reason (R): This situation is called as inspection.
Question. Assertion (A): Stacks and queues are linear data structures
Reason (R): Lists, tuples, dictionaries, sets are Python built-in linear data structures.
Question. Assertion (A): LIFO is a technique to access data from queues
Reason (R): LIFO stands for Last In First Out
Question. Assertion (A): A complex arithmetic operations can be converted into polish strings.
Reason (R): Example of Stacks application is reversal of a given line.
Attempt any 4 sub-parts from each question. Each subpart carries 1 mark.
I. Here is the code for pop method in stack to print a string in reverse order. But there is some missing word. Answer the questions that follow to execute the code successfully.
def popstack (stack)_____________ # Line 1
if is empty (stack) : # Line 2
____________# Line 3
____________ : # Line 4
top = len(stack) _ # Line 5
for a in range (top, –1, –1) :
print stack__, # Line 7
Question. Fill the blank in line 3
Question. Which symbol is used to terminate the function popstack ( )?
Question. Which variable or keyword will be best suited in fill the blank in line 4?
Question. Which value will be used in line 7?
Question. Fill the blank in line 5
II. Millions of computer science students have taken a course on algorithms and data structures, typically the second course after the initial one introducing programming. One of the basic data structures in such a course is the stack. The stack has a special place in the emergence of computing as a science, as argued by Michael Mahoney, the pioneer of the history of the theory of computing. The Stack can be used in many computer applications, few are given below:
(A) In recursive function
(B) When function is called.
(C) Expression conversion such as – Infix to Postfix,
(D) Infix to Prefix, Postfix to Infix, Prefix to Infix.
In Stack, insertion operation is known as Push whereas deletion operation is known as pop.
Code – 1
def push (Country, N) :
Country. ______ (N) # Statement 1
# Function Calling
C=[‘Indian’, ‘USA’, ‘UK’, ‘Canada’, ‘Sri Lanka’]
for i in range (0, len(C), ______ ) : # Statement 2
push (Country, C[i])
[‘Indian’, ‘UK’, ‘Shri Lanka’]
Code – 2
def pop (Country) :
if __________ : #Statement 3
return “Under flow”
return Country. __________ ( ) #Statement 4
# Function Calling
for i in range(len(Country)+1) :
pritnt ( __________ ) #Statement 5
Fill the above statement based on given questions:
Question. Fill the Statement 2, to insert the alternate element from Country list.
Question. Fill the statement 3, to check the stack is empty.
(B) Country. is Empty()
(D) No of the above
Question. Identify the suitable code for the blank of Statement 1.
(D) .append(len(Country), N)
Question. Fill the statement 5, to call the pop function.
(C) call pop(Country)
(D) def pop(Country)
Question. Fill the statement 4, to delete an element from the stack.
(C) del country
(D) Country. delete(1)
Case Based MCQs :
Direction Read the case and answer the following questions.
Mr. Rajeshwar has created a stack whose size is fixed for 10 elements and wants to perform some operations on it. He wants to push certain elements and pop some elements from it. He is confused about the operations and how the elements will behave on pushing and popping?
Help him to find the answers of the following questions.
Question. If 3 elements are popped out and 2 pushed in , what will be the strength of the stack?
Question. If “Tata” and “Datsun” are pushed to the initial stack respectively , which element will be popped out as a result of a pop operation now?
Question. How many elements he needs to take out before “RolsRoyce” will come out?
Question. If 2 elements are popped out and 4 pushed into the initial stack, how many times a loop needs to iterate to traverse the stack?
Question. How many elements can he push more to the stack?