MCQ Question for Class 12 Computer Science Chapter 1 Data Structures

MCQs Class 12

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
(a) Create
(b) Push
(c) Evaluation
(d) Pop 

Answer

B

Question. In a stack, if a user tries to remove an element from empty stack is called
(a) Underflow
(b) Overflow
(c) Empty
(d) Garbage collection 

Answer

A

Question. Which data structure is needed to convert infix notation to postfix notation?
(a) Branch
(b) Tree
(c) Queue
(d) Stack

Answer

D

Question. Pile of books is an example of ……… .
(a) stack
(b) queue
(c) array
(d) linked list 

Answer

A

Question. Which of the following is/are linear data structure(s)?
(a) Array
(b) Stack
(c) Queue
(d) All of these

Answer

D

Question. Integer, real, character, pointer and reference are ……… data structures.
(a) primitive
(b) non-primitive
(c) linear
(d) non-linear 

Answer

A

Question. Process of removing an element from stack is called
(a) Create
(b) Push
(c) Evaluation
(d) Pop

Answer

D

Question. ………… of data structure means processing all thedata elements of it.
(a) Traversal
(b) Searching
(c) Insertion
(d) Merging

Answer

A

Question. Data structures are
(a) network structures
(b) group of data
(c) different types of data
(d) different operations on data

Answer

B

Question. Pushing an element into stack already having five elements and stack size of 5, then stack becomes
(a) Overflow
(b) Uses flow
(c) Crash
(d) Underflow 

Answer

A

Question. The prefix form of A-B/ (C * D ^ E) is
(A) -/*^ACBDE
(B) -A/B*C^DE
(C) -ABCD*^DE
(D) -A/BC*^DE

Answer

B

Question. The result of evaluating the postfix expression 5, 4, 6, +, *, 4, 9, 3, /, +, * is?
(A) 600
(B) 350
(C) 650
(D) 588

Answer

B

Question. Consider the following operation performed on a stack of size 5.
Push(1);
Pop();
Push(2);
Push(3);
Pop();
Push(4);
Pop();
Pop();
Push(5);
After the completion of all operation, the number of elements present in stack are
(A) 1
(B) 2
(C) 3
(D) 4

Answer

A

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

Answer

D

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 /

Answer

A

Question. The data structure required to check whether an expression contains balanced parenthesis is
(A) Stack
(B) Queue
(C) Array
(D) Tree

Answer

A

Question. What data structure would you most likely see in a non recursive implementation of a recursive algorithm?
(A) Linked List
(B) Stack
(C) Queue
(D) Tree

Answer

B

Question. The data structure required for Breadth First Traversal on a graph is
(A) Stack
(B) Array
(C) Queue
(D) Tree

Answer

C

Question. Circular Queue is also known as _________
(A) Ring Buffer
(B) Square Buffer
(C) Rectangle Buffer
(D) Curve Buffer

Answer

A

Question. In a stack all deletions takes place at _______ end.
(A) front
(B) top
(C) rear
(D) end

Answer

B

Question. When a stack is full and no element can be added, it is called an ________.
(A) Overflow
(B) Extraflow
(C) Out of range
(D) Underflow

Answer

A

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).

Answer

D

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.

Answer

A

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.

Answer

A

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.

Answer

D

Question. Assertion (A): Simple data structures are built from primitive data types.
Reason (R): Stacks and queues are simple data structures.

Answer

C

Question. Assertion (A): The element in stack is removed from the top.
Reason (R): The process of removal is called POP.

Answer

A

Question. Assertion (A): An error occurs when one tries to delete an empty stack.
Reason (R): This situation is called as inspection.

Answer

C

Question. Assertion (A): Stacks and queues are linear data structures
Reason (R): Lists, tuples, dictionaries, sets are Python built-in linear data structures.

Answer

B

Question. Assertion (A): LIFO is a technique to access data from queues
Reason (R): LIFO stands for Last In First Out

Answer

D

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.

Answer

B

Case-based MCQs

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
return

Question. Fill the blank in line 3
(A) return
(B) True
(C) False
(D) 0

Answer

A

Question. Which symbol is used to terminate the function popstack ( )?
(A) ;
(B) :
(C) ,
(D) !

Answer

B

Question. Which variable or keyword will be best suited in fill the blank in line 4?
(A) elif
(B) for
(C) while
(D) else

Answer

D

Question. Which value will be used in line 7?
(A) (A)
(B) [a]
(C) <a>
(D) {a}

Answer

B

Question. Fill the blank in line 5
(A) 0
(B) 1
(C) 2
(D) –1

Answer

D

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
Country=[ ]
C=[‘Indian’, ‘USA’, ‘UK’, ‘Canada’, ‘Sri Lanka’]
for i in range (0, len(C), ______ ) : # Statement 2
push (Country, C[i])
     print (Country)
Required Output:
[‘Indian’, ‘UK’, ‘Shri Lanka’]
Code – 2
def pop (Country) :
if __________ : #Statement 3
     return “Under flow”
else :
       return Country. __________ ( ) #Statement 4
# Function Calling
for i in range(len(Country)+1) :
      pritnt ( __________ ) #Statement 5
Required Output:
Sri Lanka
UK
India
Under flow

Fill the above statement based on given questions:

Question. Fill the Statement 2, to insert the alternate element from Country list.
(A) 3
(B) 0
(C) –1
(D) 2

Answer

D

Question. Fill the statement 3, to check the stack is empty.
(A) Country=[]
(B) Country. is Empty()
(C) len(Country)==0
(D) No of the above

Answer

C

Question. Identify the suitable code for the blank of Statement 1.
(A) .append()
(B) .insert()
(C) .extend()
(D) .append(len(Country), N)

Answer

A

Question. Fill the statement 5, to call the pop function.
(A) pop(C)
(B) pop(Country)
(C) call pop(Country)
(D) def pop(Country)

Answer

B

Question. Fill the statement 4, to delete an element from the stack.
(A) pop(1)
(B) pop()
(C) del country[1]
(D) Country. delete(1)

Answer

B

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?

MCQ Question for Class 12 Computer Science Chapter 1 Data Structures

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?
(a) 2
(b) 4
(c) 0
(d) 1

Answer

B

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?
(a) Chevrolet
(b) Datsun
(c) Tata
(d) RolsRoyce

Answer

B

Question. How many elements he needs to take out before “RolsRoyce” will come out?
(a) 2
(b) 3
(c) 4
(d) 1

Answer

C

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?
(a) 6
(b) 3
(c) 7
(d) 4

Answer

C

Question. How many elements can he push more to the stack?
(a) 3
(b) 5
(c) 4
(d) 1

Answer

B