CS/IT Gate Yearwise
CS/IT Gate 2026 (Set 2)
CS/IT Gate 2025 (Set 1)
CS/IT Gate 2025 (Set 2)
CS/IT Gate 2024 (Set 1)
CS/IT Gate 2024 (Set 2)
CS/IT Gate 2023
CS/IT Gate 2022
CS/IT Gate 2021 (Set 1)
CS/IT Gate 2021 (Set 2)
CS/IT Gate 2020
CS/IT Gate 2019
CS/IT Gate 2018
CS/IT Gate 2017 (Set 1)
CS/IT Gate 2017 (Set 2)
CS/IT Gate 2016 (Set 1)
CS/IT Gate 2016 (Set 2)
CS/IT Gate 2015 (Set 1)
CS/IT Gate 2015 (Set 2)
CS/IT Gate 2015 (Set 3)
CS/IT Gate 2014 (Set 1)
CS/IT Gate 2014 (Set 2)
CS/IT Gate 2014 (Set 3)
CS and IT Gate 2016 Set-2 Questions with Answer
Ques 27 Gate 2016 Set-2
In an Ethernet local area network, which one of the following statements is TRUE ?
PROCESSED
Ques 28 Gate 2016 Set-2
Anarkali digitally signs a message and sends it to Salim. Verification of the signature by Salim requires
PROCESSED
Ques 29 Gate 2016 Set-2
The number of ways in which the numbers 1, 2, 3, 4, 5, 6, 7 can be inserted in an empty binary search tree, such that the resulting tree has height 6, is _____________.
Note: The height of a tree with a single node is 0.
Ques 30 Gate 2016 Set-2
A complete binary min-heap is made by including each integer in [1, 1023] exactly once. The depth of a node in the heap is the length of the path from the root of the heap to that node. Thus, the root is at depth 0. The maximum depth at which integer 9 can appear is _____________
Ques 31 Gate 2016 Set-2
In an adjacency list representation of an undirected simple graph G = (V, E), each edge (u, v) has two adjacency list entries: [v] in the adjacency list of u, and [u] in the adjacency list of v. These are called twins of each other. A twin pointer is a pointer from an adjacency list entry to its twin. If |E| = m and |V| = n, and the memory size is not a constraint, what is the time complexity of the most efficient algorithm to set the twin pointer in each entry in each adjacency list?
PROCESSED
Ques 32 Gate 2016 Set-2
Consider the following New-order strategy for traversing a binary tree:
Visit the root;
Visit the right subtree using New-order
Visit the left subtree using New-order
The New-order traversal of the expression tree corresponding to the reverse polish expression 3 4 * 5 - 2 ˆ 6 7 * 1 + - is given by:
PROCESSED
Ques 33 Gate 2016 Set-2
B+ Trees are considered BALANCED because
PROCESSED
Ques 34 Gate 2016 Set-2
Consider the following database schedule with two transactions, T1 and T2.
S = r2(X); r1(X); r2(Y); w1(X); r1(Y); w2(X); a1; a2;
where ri(Z) denotes a read operation by transaction Ti on a variable Z, wi(Z) denotes a write operation by Ti on a variable Z and ai denotes an abort by transaction Ti . Which one of the following statements about the above schedule is TRUE?
PROCESSED
Ques 35 Gate 2016 Set-2
Suppose a database schedule S involves transactions T1, ....Tn. Construct the precedence graph of S with vertices representing the transactions and edges representing the conflicts. If S is serializable, which one of the following orderings of the vertices of the precedence graph is guaranteed to yield a serial schedule?
PROCESSED
Ques 36 Gate 2016 Set-2
Let A1, A2, A3, and A4 be four matrices of dimensions 10 x 5, 5 x 20, 20 x 10, and 10 x 5, respectively. The minimum number of scalar multiplications required to find the product A1 A2A3A4 using the basic matrix multiplication method is______________.
Ques 37 Gate 2016 Set-2
Breadth First Search (BFS) is started on a binary tree beginning from the root vertex. There is a vertex t at a distance four from the root. If t is the n-th vertex in this BFS traversal, then the maximum possible value of n is ________
Ques 38 Gate 2016 Set-2
N items are stored in a sorted doubly linked list. For a delete operation, a pointer is provided to the record to be deleted. For a decrease-key operation, a pointer is provided to the record on which the operation is to be performed.
An algorithm performs the following operations on the list in this order:
Θ(N) delete, O(log N) insert, O(log N) find, and Θ(N) decrease-key What is the time complexity of all these operations put together
Given:
A sorted doubly linked list containing N items.
Pointers are provided directly to the nodes for delete and decrease-key operations.
Sequence of operations:
- Θ(N) delete operations
- O(log N) insert operations
- O(log N) find operations
- Θ(N) decrease-key operations
To find:
The overall time complexity of all these operations put together.
Solution:
Let me analyze the time taken by each operation on a sorted doubly linked list one by one.
First, for the delete operation:
Since a direct pointer to the record to be deleted is given, we just need to update the prev and next pointers of the adjacent nodes.
Time taken for 1 delete = O(1).
Total time for Θ(N) delete operations = Θ(N) × O(1) = O(N).
Next, for the insert operation:
Since it is a linked list, we do not have random access, so we cannot do binary search. We have to scan linearly to find the correct sorted position.
Time taken for 1 insert = O(N).
Total time for O(log N) insert operations = O(log N) × O(N) = O(N log N).
Next, for the find operation:
Again, no random access, so linear search is required to find an element.
Time taken for 1 find = O(N).
Total time for O(log N) find operations = O(log N) × O(N) = O(N log N).
Now, for the decrease-key operation:
A pointer to the record is provided, but decreasing the key value means the node may no longer be in sorted order.
To restore the sorted order, we have to shift the node backwards along the list to its appropriate position.
In the worst case, shifting takes O(N) steps.
Time taken for 1 decrease-key = O(N).
Total time for Θ(N) decrease-key operations = Θ(N) × O(N) = O(N2).
Now adding up the time complexities of all operations:
Total Time = O(N) + O(N log N) + O(N log N) + O(N2)
The O(N2) term clearly dominates the entire sum.
So, the total time complexity is O(N2).
Answer:
(C) O(N2)
Ques 39 Gate 2016 Set-2
The Floyd-Warshall algorithm for all-pair shortest paths computation is based on
Given:
Floyd-Warshall algorithm for all-pair shortest paths computation.
To find:
The algorithm design paradigm it is based on.
Solution:
Let me recall how the Floyd-Warshall algorithm works.
It computes the shortest path between all pairs of vertices in a directed, weighted graph.
Let d(k)[i][j] be the shortest path from vertex i to vertex j using only intermediate vertices from the set {1, 2, ..., k}.
The recurrence relation is:
d(k)[i][j] = min(d(k-1)[i][j], d(k-1)[i][k] + d(k-1)[k][j])
This shows that the problem exhibits optimal substructure and overlapping subproblems.
We build the solution bottom-up by iteratively increasing the set of allowed intermediate vertices from k = 1 to n.
Therefore, this algorithm directly uses the Dynamic Programming approach.
Answer: (C) Dynamic Programming paradigm.
Total Unique Visitors