Computer Science and Information Technology
GATE CSE topic:computer-science PYQs
Build your understanding with focused practice from past exam papers.
Questions 341–350 of 975. Imported answers require independent review unless marked reviewed.
Question 41
Open questionCS1MCQ2 marksNeeds review
An array [82, 101, 90, 11, 111, 75, 33, 131, 44, 93] is heapified. Which one of the following options represents the first three elements in the heapified array?
Your answerChoose one option.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 41
Open questionCSMCQ2 marksNeeds review
Let M be the 5-state NFA with ε-transitions shown in the diagram below.

Which one of the following regular expressions represents the language accepted by M?
Your answerChoose one option.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 42
Open questionCS1MCQ2 marksNeeds review
Consider the following recurrence relation:
Which one of the following options is CORRECT?
Your answerChoose one option.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 42
Open questionCSMCQ2 marksNeeds review
Consider an array X that contains n positive integers. A subarray of X is defined to be a sequence of array locations with consecutive indices.
The C code snippet given below has been written to compute the length of the longest subarray of X that contains at most two distinct integers. The code has two missing expressions labeled (P) and (Q).
int first=0, second=0, len1=0, len2=0, maxlen=0;
for (int i=0; i < n; i++) {
if (X[i] == first) {
len2++; len1++;
} else if (X[i] == second) {
len2++;
len1 = (P);
second = first;
} else {
len2 = (Q);
len1 = 1; second = first;
}
if (len2 > maxlen) {
maxlen = len2;
}
first = X[i];
}
Which one of the following options gives the CORRECT missing expressions?
(Hint: At the end of the i-th iteration, the value of len1 is the length of the longest subarray ending with X[i] that contains all equal values, and len2 is the length of the longest subarray ending with X[i] that contains at most two distinct values.)
Your answerChoose one option.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 43
Open questionCS1MCQ2 marksNeeds review
Consider a binary min-heap containing 105 distinct elements. Let k be the index (in the underlying array) of the maximum element stored in the heap. The number of possible values of k is
Your answerChoose one option.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 43
Open questionCSMCQ2 marksNeeds review
Consider the following expression:
. The following sequence shows the list of triples representing the given expression, with entries missing for triples (1), (3), and (6).Triple | Operator | Argument 1 | Argument 2 |
|---|---|---|---|
(0) | + | p | r |
(1) | | | |
(2) | minus | (1) | |
(3) | | | |
(4) | / | u | w |
(5) | + | (3) | (4) |
(6) | | | |
(7) | = | (6) | (5) |
Which one of the following options fills in the missing entries CORRECTLY?
Your answerChoose one option.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 44
Open questionCS1MSQ2 marksNeeds review
The symbol
indicates functional dependency in the context of a relational database. Which of the following options is/are TRUE?Your answerSelect all correct options. You can choose more than one.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 44
Open questionCSMCQ2 marksNeeds review
Let
and
be random variables, not necessarily independent, that take real values in the interval
. Let
and let the mean values of
be
, respectively. Which one of the following statements is TRUE?Your answerChoose one option.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 45
Open questionCS1MSQ2 marksNeeds review
Let G be a directed graph and T a depth first search (DFS) spanning tree in G that is rooted at a vertex v. Suppose T is also a breadth first search (BFS) tree in G, rooted at v. Which of the following statements is/are TRUE for every such graph G and tree T?
Your answerSelect all correct options. You can choose more than one.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 45
Open questionCSMCQ2 marksNeeds review
The relation schema,
, describes the city of residence for every person uniquely identified by pid. The following relational algebra operators are available: selection, projection, cross product, and rename.To find the list of cities where at least 3 persons reside, using the above operators, the minimum number of cross product operations that must be used is
Your answerChoose one option.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer