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.
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?
ALevel order traversal groups mutations by depth, not by evolutionary chronology.
BPerforming an inorder traversal yields the desired mutation sequence along the main lineage.
CA preorder traversal starts with the main mutation, missing proper side branch sequencing.
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.
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?
AAllow the duplicate in the left subtree and continue
BAllow the duplicate in the right subtree and continue
CIgnore the duplicate and continue inserting unique values
DReplace the existing node with the duplicate value and continue
Show answerHide answer
Correct answer: (C) Ignore the duplicate and continue inserting unique values
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?
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
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'?
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.
AA, B, D, H, I, E, J, K, C, F, G, L
BH, D, I, B, J, E, K, A, L, F, C, G
CH, I, D, J, K, E, B, L, F, G, C, A
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
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.
Which of the following statements is TRUE for the function prototype declaration given below?
int *(*P) (char *Q[]);
AP is a function that accepts an argument which is a character array and returns a pointer to an integer quantity.
BP is a function that accepts an argument which is a pointer to a character array and returns a pointer to an integer quantity.
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.
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.
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.
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)
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
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.
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
Consider the binary search tree with n elements. The time required to search given element is: _______
AO(log n)
BO(n log n)
CO(n² log n)
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.