CIL MT · Computer Science

Data Structures Previous Year Questions

56 Data Structures (Computer Science) questions asked in CIL MT previous year papers, each with the correct answer and explanation. Read them free on UTpaper, or attempt the full papers as timed online tests.

  • 56 questions
  • Official answer key
  • Free

Other Computer Science topics

Q1CIL MT Systems, 24 Aug 2026 (3:00 PM, CBT-26)
Given the 2D array int arr[3][3] = {{1,2,3}, {4,5,6}, {7,8,9}};, what is the value of *(*(arr + 1) + 2)?
  1. A8
  2. B3
  3. C6
  4. D5
Show answerHide answer

Correct answer: (C) 6

Q2CIL MT Systems, 24 Aug 2026 (3:00 PM, CBT-26)
Which of the following is a valid declaration for a 2D array in C?
  1. Aint a[2,2] = {{1,2}, {3,4}};
  2. Barray a[2][2] = {{1,2}, {3,4}};
  3. Cint a[2][2] = {{1,2}, {3,4}};
  4. Dint a[][] = {{1,2}, {3,4}};
Show answerHide answer

Correct answer: (C) int a[2][2] = {{1,2}, {3,4}};

Q3CIL MT Systems, 24 Aug 2026 (3:00 PM, CBT-26)
Which of the following traversals can be used to reconstruct a unique binary tree, if combined with Preorder?
  1. AInorder
  2. BPostorder
  3. CPreorder alone is enough
  4. DLevel Order
Show answerHide answer

Correct answer: (A) Inorder

Q4CIL MT Systems, 24 Aug 2026 (3:00 PM, CBT-26)
Which statement best describes a zero-address instruction in stack-based architectures?
  1. AOperands are implicitly taken from the top of the stack.
  2. BOperands are fetched directly from main memory.
  3. CThe instruction contains two explicit operand fields.
  4. DOperands are stored in accumulator registers.
Show answerHide answer

Correct answer: (A) Operands are implicitly taken from the top of the stack.

Q5CIL MT Systems, 24 Aug 2026 (3:00 PM, CBT-26)
The hardware organization of associative memory consists of:
  1. AArgument Register(A), Key Register(K) and Match Register(M) Only
  2. BMemory Array Logic, Key Register(K) and Match Register(M) Only
  3. CArgument Register(A), Memory Array Logic and Match Register(M) Only
  4. DMemory Array Logic, Argument Register(A), Key Register(K) and Match Register(M)
Show answerHide answer

Correct answer: (D) Memory Array Logic, Argument Register(A), Key Register(K) and Match Register(M)

Q6CIL MT Systems, 24 Aug 2026 (3:00 PM, CBT-26)
What is the best approach to delete an element from an unsorted array?
  1. AShift all elements left after deletion
  2. BReplace the element with the last element and reduce the array size
  3. CSort the array and then delete
  4. DReplace the element with 0
Show answerHide answer

Correct answer: (B) Replace the element with the last element and reduce the array size

Q7CIL MT Systems, 24 Aug 2026 (3:00 PM, CBT-26)
Consider the following declaration of array in C language. int arr[5]; Which of the following statements is TRUE about array ‘arr’?
  1. AThe ‘arr’ array can store integers and float values
  2. BThe declaration of the array ‘arr’ is incorrect and will result in an error
  3. CThe size of array ‘arr’ can be increased or decreased during run time dynamically
  4. DThe ‘arr’ array can store only integer values
Show answerHide answer

Correct answer: (D) The ‘arr’ array can store only integer values

Q8CIL MT Systems, 24 Aug 2026 (3:00 PM, CBT-26)
Suppose an array contains N elements. Which of the following best represents the time complexity of traversing every alternate element?
  1. AO(N²)
  2. BO(1)
  3. CO(log N)
  4. DO(N)
Show answerHide answer

Correct answer: (D) O(N)

Q9CIL MT Systems, 24 Aug 2026 (3:00 PM, CBT-26)
A botanist creates a digital representation of a rare plant's evolutionary tree, where each node records a unique genetic mutation. During research, they need to extract the chronological sequence of mutations as they would naturally occur along the main lineage. Which traversal algorithm, when applied to the tree, most accurately reflects the order of these mutations if left sub-branches represent earlier side mutations and right sub-branches represent later side mutations?
  1. ALevel order traversal groups mutations by depth, not by evolutionary chronology.
  2. BPerforming an inorder traversal yields the desired mutation sequence along the main lineage.
  3. CA preorder traversal starts with the main mutation, missing proper side branch sequencing.
  4. DApplying a postorder traversal lists mutations from leaves to root, not main lineage order.
Show answerHide answer

Correct answer: (B) Performing an inorder traversal yields the desired mutation sequence along the main lineage.

Q10CIL MT Systems, 24 Aug 2026 (3:00 PM, CBT-26)
What is the initial value of top in an empty stack implemented using an array?
  1. A-1
  2. B1
  3. C0
  4. DDepends on stack size
Show answerHide answer

Correct answer: (A) -1

Q11CIL MT Systems, 24 Aug 2026 (3:00 PM, CBT-26)
What is the worst-case time complexity of a linear search algorithm in an unsorted array of n elements?
  1. AO(1)
  2. BO(log n)
  3. CO(n log n)
  4. DO(n)
Show answerHide answer

Correct answer: (D) O(n)

Q12CIL MT Systems, 24 Aug 2026 (3:00 PM, CBT-26)
In a circular queue implemented using an array, how is the rear counter updated after an enqueue operation?
  1. AIncremented and wrapped around to the start if needed
  2. BThe rear counter is incremented but never wrapped around to the start
  3. CReset to zero unconditionally
  4. DNo update to rear pointer is needed in the enqueue operation
Show answerHide answer

Correct answer: (A) Incremented and wrapped around to the start if needed

Q13CIL MT Systems, 24 Aug 2026 (3:00 PM, CBT-26)
Which of the following best describes the relationship between pointers and 1D array declaration in C programming language?
  1. AThe array name points to the first element, but is not a modifiable pointer.
  2. BThe array name and any pointer variable are interchangeable.
  3. CThe array name points to the last element of the array.
  4. DThe array name is a pointer variable and can be reassigned to a new address
Show answerHide answer

Correct answer: (A) The array name points to the first element, but is not a modifiable pointer.

Q14CIL MT Systems, 24 Aug 2026 (3:00 PM, CBT-26)
Which statement about left recursion in context-free grammars is accurate?
  1. ALeft recursion can be direct or indirect and may lead to infinite recursion in top-down parsers.
  2. BLeft recursion is required for building LL(1) parsers without any modification.
  3. CLeft recursion has no impact on recursive-descent parsing.
  4. DLeft recursion occurs when a non-terminal appears at the end of its own production.
Show answerHide answer

Correct answer: (A) Left recursion can be direct or indirect and may lead to infinite recursion in top-down parsers.

Q15CIL MT Systems, 24 Aug 2026 (3:00 PM, CBT-26)
You are tasked to construct a binary search tree (BST) from a stream of incoming sensor readings, where each reading is processed as it arrives. Midway, the sensor malfunctions and emits a duplicate reading not originally in the stream. To preserve BST properties and ensure efficient future search operations, which strategy should you employ for the duplicate reading?
  1. AAllow the duplicate in the left subtree and continue
  2. BAllow the duplicate in the right subtree and continue
  3. CIgnore the duplicate and continue inserting unique values
  4. DReplace the existing node with the duplicate value and continue
Show answerHide answer

Correct answer: (C) Ignore the duplicate and continue inserting unique values

Q16CIL MT Systems, 24 Aug 2026 (3:00 PM, CBT-26)
What does a node in a singly linked list typically contain?
  1. AData and one pointer
  2. BA pointer only
  3. CData and two pointers
  4. DData only
Show answerHide answer

Correct answer: (C) Data and two pointers

Q17CIL MT Systems, 24 Aug 2026 (3:00 PM, CBT-26)
Which parsing method uses a stack to store symbols and reduces them when a right-hand side pattern is recognized?
  1. ATop-Down Parsing
  2. BRecursive Descent Parsing
  3. CPredictive Parsing
  4. DShift-Reduce Parsing
Show answerHide answer

Correct answer: (D) Shift-Reduce Parsing

Q18CIL MT Systems, 24 Aug 2026 (3:00 PM, CBT-26)
Consider a binary search tree (BST). Which one of the following properties is always true for an inorder traversal of the BST?
  1. AIt gives the nodes in descending order of values of keys
  2. BIt gives the nodes in random order of values of keys
  3. CIt only visits the leftmost and rightmost nodes
  4. DIt gives the nodes in ascending order of values of keys
Show answerHide answer

Correct answer: (D) It gives the nodes in ascending order of values of keys

Q19CIL MT Systems, 26 Mar 2017 (12:30 PM)
Which of the following data structures allows both addition and deletion of items from either end?
  1. ADouble Ended Queue
  2. BQueue
  3. CPriority Queue
  4. DStack
Show answerHide answer

Correct answer: (A) Double Ended Queue

Q20CIL MT Systems, 26 Mar 2017 (12:30 PM)
Which of the following is an NP-complete problem?
  1. ATuring's Halting problem
  2. BCNF-Satisfiability problem
  3. CPresburger Arithmetic problem
  4. DNumber of Hamiltonian circuits in a complete graph of 'n' vertices with n > 2
Show answerHide answer

Correct answer: (B) CNF-Satisfiability problem

Q21CIL MT Systems, 26 Mar 2017 (12:30 PM)
Let K2,2 be a complete bipartite graph with vertices 1 and 2 on one side and vertices 3 and 4 on the other side (each of 1 and 2 is joined to both 3 and 4). Which of the following is the total number of paths of length 3 from vertex 1 to vertex 4?
  1. A2
  2. B3
  3. C4
  4. D1
Show answerHide answer

Correct answer: (C) 4

Q22CIL MT Systems, 26 Mar 2017 (12:30 PM)
Which of the following is the Postorder traversal of the binary tree whose Inorder and Preorder traversals are as follows? In-order : OLCHJBEKNGMADFI Preorder : KHLOCBJEAGNMFDI
  1. AADFLIBNCJEMGHOK
  2. BOCLJEBGDIAFNMHK
  3. CADFLIBNMGJCEHOK
  4. DOCLJEBHNMGDIFAK
Show answerHide answer

Correct answer: (D) OCLJEBHNMGDIFAK

Q23CIL MT Systems, 26 Mar 2017 (12:30 PM)
If P is a two-dimensional array having 10 rows and 20 columns, then which of the following cannot be used to access the element in row 2 and column 5?
  1. AP[2][5]
  2. B*(*(P + 2) + 5)
  3. C*(P[2] + 5)
  4. D*(P + 2 + 5)
Show answerHide answer

Correct answer: (D) *(P + 2 + 5)

Q24CIL MT Systems, 26 Mar 2017 (12:30 PM)
Consider the following Adjacency matrix corresponding to some weighted Graph 'G' (rows and columns are vertices 1 to 5). Vertex 1: 0 5 0 10 2 Vertex 2: 5 0 4 6 2 Vertex 3: 0 4 0 1 0 Vertex 4: 10 6 1 0 7 Vertex 5: 2 2 0 7 0 What is the weight of the minimum spanning tree for the graph 'G'?
  1. A11
  2. B9
  3. C10
  4. D8
Show answerHide answer

Correct answer: (B) 9

Q25CIL MT Systems, 26 Mar 2017 (12:30 PM)
In a B-Tree of order m (m > 1), every non-leaf node (except root node) has the number of children between:
  1. Am/2 and m
  2. B⌈m/2⌉ and m
  3. C⌊m/2⌋ and m
  4. D⌊m/2⌋ and ⌈m/2⌉
Show answerHide answer

Correct answer: (B) ⌈m/2⌉ and m

Q26CIL MT Systems, 26 Mar 2017 (12:30 PM)
Match the following. List-I: I) Dijkstra's Algorithm, II) Tower of Hanoi, III) Floyd-Warshall Algorithm, IV) Merge Sort List-II: P) Divide and Conquer Approach, Q) Greedy Approach, R) Dynamic Approach, S) Recursion
  1. AI – Q, II – S, III – R, IV – P
  2. BI – S, II – Q, III – P, IV – R
  3. CI – S, II – Q, III – R, IV – P
  4. DI – Q, II – S, III – P, IV – R
Show answerHide answer

Correct answer: (A) I – Q, II – S, III – R, IV – P

Q27CIL MT Systems, 26 Mar 2017 (12:30 PM)
The listing of nodes after applying the preorder traversal over the following binary tree is: A is the root. A has left child B and right child C. B has left child D and right child E. C has left child F and right child G. D has children H (left) and I (right). E has children J (left) and K (right). F has a single left child L.
  1. AA, B, D, H, I, E, J, K, C, F, G, L
  2. BH, D, I, B, J, E, K, A, L, F, C, G
  3. CH, I, D, J, K, E, B, L, F, G, C, A
  4. DA, B, D, H, I, E, J, K, C, F, L, G
Show answerHide answer

Correct answer: (D) A, B, D, H, I, E, J, K, C, F, L, G

Q28CIL MT Systems, 26 Mar 2017 (12:30 PM)
Maximum number of edges in a simple graph with 'n' vertices and 'k' components is:
  1. A(n − 2)(n − 1)/2 + 1
  2. B(n − k)(n − k + 1)/2
  3. Cn²
  4. Dn(n − 1)/2
Show answerHide answer

Correct answer: (B) (n − k)(n − k + 1)/2

Q29CIL MT Systems, 26 Mar 2017 (12:30 PM)
Total number of spanning tree of a complete graph of 4 vertices K₄ is:
  1. A15
  2. B16
  3. C3
  4. D17
Show answerHide answer

Correct answer: (B) 16

Q30CIL MT Systems, 26 Mar 2017 (12:30 PM)
If T is a binary tree with N nodes, then the number of levels is at least:
  1. A⌈log₂(N + 1)⌉
  2. BN − 1
  3. CN
  4. D⌊log₂(N + 1)⌋
Show answerHide answer

Correct answer: (A) ⌈log₂(N + 1)⌉

Q31CIL MT Systems, 26 Mar 2017 (12:30 PM)
Which of the following declares 'pf' as a pointer to a function, which returns an integer quantity and requires two integer arguments?
  1. Aint *pf(int, int);
  2. Bint (*pf) (int, int);
  3. C(int *) pf(int, int);
  4. Dint (int *pf(int, int));
Show answerHide answer

Correct answer: (B) int (*pf) (int, int);

Q32CIL MT Systems, 26 Mar 2017 (12:30 PM)
Which of the following is the best-case time complexity of Floyd's algorithm for finding shortest paths in a graph with 'n' vertices?
  1. AΘ(n²)
  2. BΘ(1)
  3. CΘ(n)
  4. DΘ(n³)
Show answerHide answer

Correct answer: (D) Θ(n³)

Q33CIL MT Systems, 26 Mar 2017 (12:30 PM)
A ______ takes a directed ______ graph G and produces a linear ordering of all its vertices such that for every directed edge <v, w> in G, the vertex v comes before the vertex w in the ordering.
  1. Abreadth first search; acyclic
  2. Btopological sort; acyclic
  3. Cbreadth first search; cyclic
  4. Dtopological sort; cyclic
Show answerHide answer

Correct answer: (B) topological sort; acyclic

Q34CIL MT Systems, 26 Mar 2017 (12:30 PM)
Match the following. List I: I) Stack, II) Heap tree, III) Tree, IV) Binary search List II: P) Non-linear, Q) Complete binary tree, R) Ordered list, S) Linear
  1. AI – S, II – R, III – P, IV – Q
  2. BI – S, II – Q, III – P, IV – R
  3. CI – S, II – P, III – Q, IV – R
  4. DI – P, II – Q, III – R, IV – S
Show answerHide answer

Correct answer: (B) I – S, II – Q, III – P, IV – R

Q35CIL MT Systems, 26 Mar 2017 (12:30 PM)
Which of the following statements is TRUE for the function prototype declaration given below? int *(*P) (char *Q[]);
  1. AP is a function that accepts an argument which is a character array and returns a pointer to an integer quantity.
  2. BP is a function that accepts an argument which is a pointer to a character array and returns a pointer to an integer quantity.
  3. CP is a pointer to a function that accepts an argument which is an array of character pointers, and returns a pointer to an integer quantity.
  4. DP is a pointer to function that accepts an argument which is a character array and returns a pointer to an integer quantity.
Show answerHide answer

Correct answer: (C) P is a pointer to a function that accepts an argument which is an array of character pointers, and returns a pointer to an integer quantity.

Q36CIL MT Systems, 26 Mar 2017 (12:30 PM)
Which of the following statements about the following binary tree is FALSE? A is the root. A has left child B and right child C. B has left child D and right child E. C has left child F and right child G. D has children H (left) and I (right). E has children J (left) and K (right). F has a single left child L.
  1. AIt is a binary search tree.
  2. BIt is a complete binary tree.
  3. CNodes 'J' and 'K' are siblings.
  4. DNode 'B' is the ancestor of node 'J'.
Show answerHide answer

Correct answer: (A) It is a binary search tree.

Q37CIL MT Systems, 26 Mar 2017 (12:30 PM)
If T is a binary tree with number of levels as L, then the number of leaf nodes in the binary tree is at most:
  1. A2^(L+1)
  2. B2L
  3. C2^L
  4. D2^(L−1)
Show answerHide answer

Correct answer: (D) 2^(L−1)

Q38CIL MT Systems, 26 Mar 2017 (12:30 PM)
If a connected graph G does not contain any vertex whose removal disconnects the rest of the graph, then G is called:
  1. ABiconnected graph
  2. BSeparable graph
  3. CForest
  4. DDiagraph
Show answerHide answer

Correct answer: (A) Biconnected graph

Q39CIL MT Systems, 27 Feb 2020 (8:00 AM)
Depth First Search graph search algorithm uses _______ data structure for its implementation.
  1. AStack
  2. Btree
  3. CDequeue
  4. DQueue
Show answerHide answer

Correct answer: (A) Stack

Q40CIL MT Systems, 27 Feb 2020 (8:00 AM)
The maximum height of a binary tree with 'n' nodes is _______.
  1. A(n + n)
  2. B(n + 1)
  3. Cn
  4. D(n − 1)
Show answerHide answer

Correct answer: (D) (n − 1)

Q41CIL MT Systems, 27 Feb 2020 (8:00 AM)
In hashing, collision resolution is carried out by close addressing. Which of the following is close addressing technique – I. Buckets (for contiguous storage) II. Chains (for linked storage)
  1. AOnly I
  2. BOnly II
  3. CI and II
  4. DNone
Show answerHide answer

Correct answer: (C) I and II

Q42CIL MT Systems, 27 Feb 2020 (8:00 AM)
Consider the following two statements. 1. A binary tree T is full if each node is either a leaf or possesses exactly two child nodes. 2. A binary tree T with n levels is complete if all levels except possibly the last are completely full, and the last level has all its nodes to the left side. Which statement is/are TRUE
  1. AOnly 2
  2. BOnly 1
  3. C1 and 2
  4. DNeither 1 nor 2
Show answerHide answer

Correct answer: (C) 1 and 2

Q43CIL MT Systems, 27 Feb 2020 (8:00 AM)
Polynomial addition is implemented using _______ data structure.
  1. ATrees
  2. BQueue
  3. CLinked list
  4. DStack
Show answerHide answer

Correct answer: (C) Linked list

Q44CIL MT Systems, 27 Feb 2020 (8:00 AM)
For implementation of recursion system uses _______ data structure.
  1. ALinked List
  2. BDeque
  3. CStack
  4. DQueue
Show answerHide answer

Correct answer: (C) Stack

Q45CIL MT Systems, 27 Feb 2020 (8:00 AM)
Queue structure is used in _______.
  1. APolynomial addition
  2. BRecursion
  3. CDepth First Search algorithm
  4. DBreadth First Search algorithm
Show answerHide answer

Correct answer: (D) Breadth First Search algorithm

Q46CIL MT Systems, 27 Feb 2020 (8:00 AM)
In ______ balance factor of a node is the difference between left subtree and right subtree.
  1. ARed Black Tree
  2. BB+ Tree
  3. CAVL tree
  4. D2-3 Tree
Show answerHide answer

Correct answer: (C) AVL tree

Q47CIL MT Systems, 27 Feb 2020 (8:00 AM)
The following is the sequence of insertion in a binary tree. 45, 65, 35, 40, 33, 70, 60, 75, 69 How many numbers of nodes in Left Sub Tree (LST) and Right Sub Tree (RST) of Root node.
  1. ALST – 6, RST – 2
  2. BLST – 5, RST – 3
  3. CLST – 3, RST – 5
  4. DLST – 2, RST – 6
Show answerHide answer

Correct answer: (C) LST – 3, RST – 5

Q48CIL MT Systems, 27 Feb 2020 (8:00 AM)
______ is First in Last Out kind of data structure.
  1. AStack
  2. BArray
  3. CDeque
  4. DQueue
Show answerHide answer

Correct answer: (A) Stack

Q49CIL MT Systems, 27 Feb 2020 (8:00 AM)
Consider the following Inorder and Preorder traversal of a tree Inorder – D B E F A G H C Preorder – A B D E F C G H What is the Postorder Traversal of the same tree
  1. AD F E B H C G A
  2. BD F E B G H C A
  3. CD F E H B G C A
  4. DD F E B H G C A
Show answerHide answer

Correct answer: (D) D F E B H G C A

Q50CIL MT Systems, 27 Feb 2020 (8:00 AM)
Consider the binary search tree with n elements. The time required to search given element is: _______
  1. AO(log n)
  2. BO(n log n)
  3. CO(n² log n)
  4. DO(n²)
Show answerHide answer

Correct answer: (A) O(log n)

How to use these CIL MT Computer Science questions

Every question here was asked in a real CIL MT paper; the paper and shift are shown on the card, and the number opens the question on its own page. Try each one before tapping Show answer, then attempt the full CIL MT papers as timed tests to check your speed under exam conditions.

More CIL MT subjects