GATE 2026 (Session 2) Computer Science and Information Technology (CS) Questions with Solutions

GATE 2026 (Session 2)

65 questions

MCQ 35 · MSQ 11 · NAT 191-mark 30 · 2-mark 35

Questions 36–40 of 65

Q36Minimum Spanning Tree2 marksMCQ−0.67 if wrong
Consider a complete graph KnK_{n} with nn vertices ( n>4n>4 ). Note that multiple spanning trees can be constructed over KnK_{n}. Each of these spanning trees is represented as a set of edges. The Jaccard coefficient between any two sets is defined as the ratio of the size of the intersection of the two sets to the size of the union of the two sets.

Which one of the following options gives the lowest possible value for the Jaccard coefficient between any two spanning trees of KnK_{n} ?

Q37Shortest Path2 marksMCQ−0.67 if wrong
Let GG be a weighted directed acyclic graph with mm edges and nn vertices. Given GG and a source vertex ss in GG, which one of the following options gives the worst case time complexity of the fastest algorithm to find the lengths of shortest paths from ss to all vertices that are reachable from ss in G?{G}?

Q38Asymptotic Notation2 marksMCQ−0.67 if wrong
Consider an array AA of integers of size nn. The indices of AA run from 11 to nn. An algorithm is to be designed to check whether AA satisfies the condition given below.

∀i,j∈{1,…,n−1}\forall i, j \in\{1, \ldots, n-1\} such that i>j,(A[i+1]−A[i])>(A[j+1]−A[j])i>j,(A[i+1]-A[i])>(A[j+1]-A[j])

Which one of the following gives the worst case time complexity of the fastest algorithm that can be designed for the problem?

Q39Dynamic Programming2 marksMCQ−0.67 if wrong
Consider a table TT, where the elements T[i][j],0≤i,j≤nT[i][j], 0 \leq i, j \leq n, represent the cost of the optimal solutions of different subproblems of a problem that is being solved using a dynamic programming algorithm. The recursive formulation to compute the table entries is as follows:

T[0][k]=T[k][0]=1 for k=0,1,2,…,nT[i][j]=2T[i−1][j]+3T[i][j−1] for 1≤i,j≤n\begin{array}{ll} T[0][k]=T[k][0]=1 & \text { for } k=0,1,2, \ldots, n \\ T[i][j]=2 T[i-1][j]+3 T[i][j-1] & \text { for } 1 \leq i, j \leq n \end{array}

Consider the following two algorithms to compute entries of TT. Assume that for both the algorithms, for all 0≤i,j≤n,T[i][j]0 \leq i, j \leq n, T[i][j] has been initialized to 11.

Algorithm B1:For i=1,2,…,nFor j=1,2,…,nT[i][j]=2T[i−1][j]+3T[i][j−1]Algorithm B2:For s=2,3,…,2nFor i=1,2,…,nFor j=1,2,…,nIf i+j==sT[i][j]=2T[i−1][j]+3T[i][j−1]\begin{aligned} &\text{Algorithm } B_1: \\ &\quad \text{For } i = 1,2,\ldots,n \\ &\quad\quad \text{For } j = 1,2,\ldots,n \\ &\quad\quad\quad T[i][j] = 2T[i-1][j] + 3T[i][j-1] \\[6pt] &\text{Algorithm } B_2: \\ &\quad \text{For } s = 2,3,\ldots,2n \\ &\quad\quad \text{For } i = 1,2,\ldots,n \\ &\quad\quad\quad \text{For } j = 1,2,\ldots,n \\ &\quad\quad\quad\quad \text{If } i + j = = s \\ &\quad\quad\quad\quad\quad T[i][j] = 2T[i-1][j] + 3T[i][j-1] \end{aligned}

Algorithm Bk,k∈{1,2}B_{k}, k \in\{1,2\} is said to be correct if and only if it calculates the correct values of T[i][j]T[i][j], for all 0≤i,j≤n0 \leq i, j \leq n, (as per the recursive formulation) at the end of the execution of the algorithm BkB_{k}.

Which one of the following statements is true?

Q40Boolean Algebra2 marksMCQ−0.67 if wrong
Consider the following 44-variable Boolean function

F(A,B,C,D)=Σm(0,1,2,3,8,9,10,11)F(A, B, C, D)=\Sigma m(0,1,2,3,8,9,10,11)

Consider AA as MSB, DD as LSB. Which one of the following options represents the minimal sum of products form for the above function?
Note: +{+} is OR operation, ⋅{\cdot} is AND operation, ′{\prime} is NOT operation