GATE CS 2005 — Question 58
Consider the grammarS → ( S ) | aLet the number of states in the SLR(1), LR(1) and LALR(1) parsers for the grammar be \(n_1\), \(n_2\) and \(n_3\)…
GATE exam stream
174 questions and papers
Consider the grammarS → ( S ) | aLet the number of states in the SLR(1), LR(1) and LALR(1) parsers for the grammar be \(n_1\), \(n_2\) and \(n_3\)…
The number of tokens in the following C statement is:printf("i = %d, &i = %x", i, &i);
Consider the following recurrence relation:\(T(n) = T(n/2) + T(2n/5) + 7n\) for \(n > 0\), and \(T(0) = 0\).Which one of the following options is correct?
There are \(n\) unsorted arrays: \(A_1, A_2, \ldots, A_n\). Assume that \(n\) is odd. Each of \(A_1, A_2, \ldots, A_n\) contains \(n\) distinct elements. There are no common elements between any two arrays. The worst-case time complexity of computing…
Assume that multiplying a matrix \(G_1\) of dimension \(p \times q\) with another matrix \(G_2\) of dimension \(q \times r\) requires \(pqr\) scalar multiplications. Computing the product of \(n\) matrices \(G_1 G_2 G_3 \ldots G_n\) using dynamic programming, the time…
A message is made up entirely of characters from the set \(X = \{P, Q, R, S, T\}\). The table of probabilities for each of the characters is shown below.CharacterProbabilityP0.22Q0.34R0.17S0.19T0.08Total1.00If…
Let \(G\) be a complete undirected graph on 4 vertices, having 6 edges with weights being 1, 2, 3, 4, 5 and 6. The maximum possible weight that…
The Floyd-Warshall algorithm for all-pair shortest paths computation is based on
An unordered list contains \(n\) distinct elements. The number of comparisons to find an element in this list that is neither maximum nor minimum is
Consider the following array of elements:<89, 19, 50, 17, 12, 15, 2, 5, 7, 11, 6, 9, 100>The minimum number of interchanges needed to convert it into a…
Every question here is free to read. A free account adds the verified key, the worked solution and your progress.