GATE CSE
Consider a matrix multiplication chain $${F_1}{F_2}{F_3}{F_4}{F_5},$$ where matrices $${F_1},{F_2},{F_3},{F_4}$$ and $${F_5}$$ are of dimensions $$2 \times 25,\,\,25 \times 3,\,\,3 \times 16,\,\,16 \times 1$$ and $$1 \times 1000,$$ respectively. In the parenthesization of $${F_1}{F_2}{F_3}{F_4}{F_5}$$ that minimizes the total number of scalar multiplications, the explicitly computed pairs is/are
Item number | Weight (in Kgs) |
Value (in Rupees) |
---|---|---|
1 | 10 | 60 |
2 | 7 | 28 |
3 | 4 | 20 |
4 | 2 | 24 |
The task is to pick a subset of these items such that their total weight is no more than $$11$$ $$Kgs$$ and their total value is maximized. Moreover, no item may be split. The total value of items picked by an optimal algorithm is denoted by $$V$$opt. A greedy algorithm sorts the items by their value-to-weight ratios in descending order and packs them greedily, starting from the first item in the ordered list. The total value of items picked by the greedy algorithm is denoted by $$V$$greedy.
The value of $$V$$opt $$−$$ $$V$$greedy is ____________.
Consider the following undirected graph $$G: $$
Choose a value for $$x$$ that will maximize the number of minimum weight spanning trees $$(MWSTs)$$ of $$G.$$ The number of $$MWSTs$$ of $$G$$ for this value of $$x$$ is ______.
$$\eqalign{ & {T_1}:\,\,\,a?{\left( {b|c} \right)^ * }a \cr & {T_2}:\,\,\,b?{\left( {a|c} \right)^ * }b \cr & {T_3}:\,\,\,c?{\left( {b|a} \right)^ * }c \cr} $$
Note that $$'x?'$$ means $$0$$ or $$1$$ occurrence of the symbol $$x.$$ Note also that the analyzer outputs the token that matches the longest possible prefix.
If the string $$bbaacabc$$ is processed by the analyzer, which one of the following is the sequence of tokens it outputs?
Which one of the following is correct for the given parse tree?
The fragmentation offset value stored in the third fragment is _______.
Assume that the system has two nodes $$P$$ and $$Q,$$ located at a distance $$d$$ meters from each other. $$P$$ starts transmitting a packet at time $$t=0$$ after successfully completing its carrier-sense phase. Node $$Q$$ has a packet to transmit at time $$t=0$$ and begins to carrier-sense the medium.
The maximum distance $$d$$ (in meters, rounded to the closest integer) that allows $$Q$$ to successfully avoid a collision between its proposed transmission and $$P’s$$ ongoing transmission is _____.
Field | Length in bits |
---|---|
P. UDP Header’s Port Number | I. 48 |
Q. Ethernet MAC Address | II. 8 |
R. IPv6 Next Header | III. 32 |
S. TCP Header’s Sequence Number | IV. 16 |
$$(i)$$ $$\,\,\,\,\,\,\,\,\,\,\,$$ The $$cwnd$$ increases by $$2$$ $$MSS$$ on every successful acknowledgment.
$$(ii)$$ $$\,\,\,\,\,\,\,\,\,$$ The $$cwnd$$ approximately doubles on every successful acknowledgement.
$$(iii)$$ $$\,\,\,\,\,\,\,$$ The $$cwnd$$ increases by $$1$$ $$MSS$$ every round trip time.
$$(iv)$$ $$\,\,\,\,\,\,\,\,\,$$ The $$cwnd$$ approximately doubles every round trip time.
Which one of the following is correct?
The number of clock cycles required for completion of execution of the sequence of instructions is ______.
The maximum value of $$N$$ is __________.
$$\,\,\,\,\,\,\,{\rm I}.\,\,\,\,\,$$ Register-to-register arithmetic operations only
$$\,\,\,\,\,{\rm I}{\rm I}.\,\,\,\,\,$$ Fixed-length instruction format
$$\,\,\,{\rm I}{\rm I}{\rm I}.\,\,\,\,\,$$ Hardwired control unit
Which of the characteristics above are used in the design of a $$RISC$$ processor?
$$(P)$$ The processor pushes the process status of $$L$$ onto the control stack.
$$(Q)$$ The processor finishes the execution of the current instruction.
$$(R)$$ The processor executes the interrupt service routine.
$$(S)$$ The processor pops the process status of $$L$$ from the control stack.
$$(T)$$ The processor loads the new PC value based on the interrupt.
Which one of the following is the correct order in which the events above occur?
$$(I)$$ No edge of $$G$$ is a cross edge with respect to $${T_D}.$$ ($$A$$ cross edge in $$G$$ is between
$$\,\,\,\,\,\,\,\,$$ two nodes neither of which is an ancestor of the other in $${T_D}.$$)
$$(II)$$ For every edge $$(u,v)$$ of $$G,$$ if $$u$$ is at depth $$i$$ and $$v$$ is at depth $$j$$ in $${T_B}$$, then
$$\,\,\,\,\,\,\,\,\,\,\,$$ $$\left| {i - j} \right| = 1.$$
Which of the statements above must necessarily be true?

Which one of the following is the time complexity of the most time-efficient implementation of $$enqueue$$ and $$dequeue,$$ respectively, for this data structure?
$$Q:$$ $$\,\,\,\,\,\,\,\,\,$$ $$r$$ $$\,\,\,\,$$ $$\bowtie$$ $$\,\,\,\,$$ $$\left( {{\sigma _{b < 5}}\left( s \right)} \right)$$
Let $$LOJ$$ denote the natural left outer-join operation. Assume that $$r$$ and $$s$$ contain no null values.
Which one of the following queries is NOT equivalent to $$Q$$?
Book (isbn, bname), Stock (isbn, copies)
Query 1: SELECT B.isbn, S.copies
FROM Book B INNER JOIN Stock S
ON B.isbn = S.isbn;
Query 2: SELECT B.isbn, S.copies
FROM Book B LEFT OUTER JOIN Stock S
ON B.isbn = S.isbn;
Query 3: SELECT B.isbn, S.copies
FROM Book B RIGHT OUTER JOIN Stock S
ON B.isbn = S.isbn;
Query 4: SELECT B.isbn, S.copies
FROM Book B FULL OUTER JOIN Stock S
ON B.isbn = S.isbn;
Which one of the queries above is certain to have an output that is a superset of the outputs
of the other three queries?Which one of the following is true about $$R$$?

The number of states in the state transition diagram of this circuit that have a transition back to the same state on some value of “in” is _____.
where the position of the binary point is between $${b_3}$$ and $${b_2}$$. Assume $${b_7}$$ is the most significant bit. Some of the decimal numbers listed below cannot be represented exactly in the above representation:
$$\,\,\,\,\,\,\,\,\,\,\,\,\,$$ $$(i)$$ $$31.500$$ $$\,\,\,\,\,\,\,\,\,\,\,\,\,$$ $$(ii)$$ $$0.875$$ $$\,\,\,\,\,\,\,\,\,\,\,\,\,$$ $$(iii)$$ $$12.100$$ $$\,\,\,\,\,\,\,\,\,\,\,\,\,$$ (iv) $$3.001$$
Which one of the following statements is true?
Here, $$m$$ denotes a minterm and $$d$$ denotes a don’t care term. The number of essential prime implicants of the function $$F$$ is ___________.
Which one of the following is NOT CORRECT?
Consider the following statements.
$$\left( {\rm I} \right)$$ $$\,\,\,\,\,\,\,\,\,\,\,\,\,\,$$ $$P$$ does not have an inverse
$$\left( {\rm II} \right)$$ $$\,\,\,\,\,\,\,\,\,\,\,$$ $$P$$ has a repeated eigenvalue
$$\left( {\rm III} \right)$$ $$\,\,\,\,\,\,\,\,\,$$ $$P$$ cannot be diagonalized
Which one of the following options is correct?
$$\,\,\,\,\,\,\,\,$$ $$P:$$ Set of Rational numbers (positive and negative)
$$\,\,\,\,\,\,\,\,$$ $$Q:$$ Set of functions from $$\left\{ {0,1} \right\}$$ to $$N$$
$$\,\,\,\,\,\,\,\,$$ $$R:$$ Set of functions from $$N$$ to $$\left\{ {0,1} \right\}$$
$$\,\,\,\,\,\,\,\,$$ $$S:$$ Set of finite subsets of $$N.$$
Which of the sets above are countable?
$$\varphi \equiv \,\,\,\,\,\,\,\exists s\exists t\exists u\forall v\forall w$$ $$\forall x\forall y\psi \left( {s,t,u,v,w,x,y} \right)$$
where $$\psi $$ $$(𝑠,𝑡, 𝑢, 𝑣, 𝑤, 𝑥, 𝑦)$$ is a quantifier-free first-order logic formula using only predicate symbols, and possibly equality, but no function symbols. Suppose $$\varphi $$ has a model with a universe containing $$7$$ elements.
Which one of the following statements is necessarily true?
The following table gives the conditional probabilities for Delhi’s temperature given Guwahati’s temperature.
HD | MD | LD | |
---|---|---|---|
HG | 0.40 | 0.48 | 0.12 |
MG | 0.10 | 0.65 | 0.25 |
LG | 0.01 | 0.50 | 0.49 |
Consider the first row in the table above. The first entry denotes that if Guwahati has high temperature $$\left( {{H_G}} \right)$$ then the probability of Delhi also having a high temperature $$\left( {{H_D}} \right)$$ is $$0.40;$$ i.e., $$P\left( {{H_D}|{H_G}} \right) = 0.40.$$ Similarly, the next two entries are $$P\left( {{M_D}|{H_G}} \right) = 0.48$$ and $$P\left( {{L_D}|{H_G}} \right) = 0.12.$$ Similarly for the other rows.
If it is known that $$P\left( {{H_G}} \right) = 0.2,\,\,$$ $$P\left( {{M_G}} \right) = 0.5,\,\,$$ and $$P\left( {{L_G}} \right) = 0.3,\,\,$$ then the probability (correct to two decimal places) that Guwahati has high temperature given that Delhi has high temperature is __________.
Consider a state of the system with the Allocation matrix as shown below, and in which $$3$$ instances of $$E$$ and $$3$$ instances of $$F$$ are the only resources available.
Allocation | |||
---|---|---|---|
E | F | G | |
P0 | 1 | 0 | 1 |
P1 | 1 | 1 | 2 |
P2 | 1 | 0 | 3 |
P3 | 2 | 0 | 0 |
Max | |||
---|---|---|---|
E | F | G | |
P0 | 4 | 3 | 1 |
P1 | 2 | 1 | 4 |
P2 | 1 | 3 | 3 |
P3 | 5 | 4 | 1 |
From the perspective of deadlock avoidance, which one of the following is true?
Currently the head is positioned at sector number $$100$$ of cylinder $$80,$$ and is moving towards higher cylinder numbers. The average power dissipation in moving the head over $$100$$ cylinders is $$20$$ milliwatts and for reversing the direction of the head movement once is $$15$$ milliwatts. Power dissipation associated with rotational latency and switching of head between different platters is negligible.
The total power consumption in milliwatts to satisfy all of the above disk requests using the Shortest Seek Time First disk scheduling algorithm is _______.
Which one of the following is the correct expression for the page fault rate experienced by the process?
#include< stdio.h >
struct Ournode{
char x,y,z;
};
int main(){
struct Ournode p = {'1', '0', 'a'+2};
struct Ournode *q = &p;
printf ("%c, %c", *((char*)q+1), *((char*)q+2));
return 0;
}
The output of this program is:#include < stdio.h >
int counter = 0;
int calc (int a, int b) {
int c;
counter++;
if (b==3) return (a*a*a);
else {
c = calc(a, b/3);
return (c*c*c);
}
}
int main (){
calc(4, 81);
printf ("%d", counter);
}
The output of this program is _____.#include< stdio.h >
void fun1(char *s1, char *s2){
char *tmp;
tmp = s1;
s1 = s2;
s2 = tmp;
}
void fun2(char **s1, char **s2){
char *tmp;
tmp = *s1;
*s1 = *s2;
*s2 = tmp;
}
int main(){
char *str1 = "Hi", *str2 = "Bye";
fun1(str1, str2); printf("%s %s ", str1, str2);
fun2(&str1, &str2); printf("%s %s", str1, str2);
return 0;
}
The output of the program above isunsigned long int fun(unsigned long int n){
unsigned long int i, j = 0, sum = 0;
for (i = n; i > 1; i = i/2) j++;
for ( ; j > 1; j = j/2) sum++;
return(sum);
}
The value returned when we call fun with the input $${2^{40}}$$ is$$\,\,\,\,\,\,\,\,{\rm I}.\,\,\,\,\,\,\,$$ $$\left\{ {{a^m}{b^n}{c^p}{d^q}} \right.|m + p = n + q,$$ where $$\left. {m,n,p,q \ge 0} \right\}$$
$$\,\,\,\,\,\,{\rm II}.\,\,\,\,\,\,\,$$ $$\left\{ {{a^m}{b^n}{c^p}{d^q}} \right.|m = n$$ and $$p=q,$$ where $$\left. {m,n,p,q \ge 0} \right\}$$
$$\,\,\,\,{\rm III}.\,\,\,\,\,\,\,$$ $$\left\{ {{a^m}{b^n}{c^p}{d^q}} \right.|m = n = p$$ and $$p \ne q,$$ where $$\left. {m,n,p,q \ge 0} \right\}$$
$$\,\,\,\,{\rm IV}.\,\,\,\,\,\,\,$$ $$\left\{ {{a^m}{b^n}{c^p}{d^q}} \right.|mn = p + q,$$ where $$\left. {m,n,p,q \ge 0} \right\}$$
Which of the languages above are context-free?
$$\,\,\,\,\,\,\,\,{\rm I}.\,\,\,\,\,\,\,$$ For an unrestricted grammar $$G$$ and a string $$W,$$ whether $$w \in L\left( G \right)$$
$$\,\,\,\,\,\,{\rm II}.\,\,\,\,\,\,\,$$ Given a Turing machine $$M,$$ whether $$L(M)$$ is regular
$$\,\,\,\,{\rm III}.\,\,\,\,\,\,\,$$ Given two grammars $${G_1}$$ and $${G_2}$$, whether $$L\left( {{G_1}} \right) = L\left( {{G_2}} \right)$$
$$\,\,\,\,{\rm IV}.\,\,\,\,\,\,\,$$ Given an $$NFA$$ $$N,$$ whether there is a deterministic $$PDA$$ $$P$$ such that $$N$$
$$\,\,\,\,\,\,\,\,\,\,\,\,\,$$ $$\,\,\,\,\,\,\,\\,\,\,$$and $$P$$ accept the same language.
Which one of the following statements is correct?
$${L^i} = {L^{i - 1}}.\,\,L$$ for all $$i > 0$$
The order of a language $$L$$ is defined as the smallest k such that $${L^k} = {L^{k + 1}}.$$ Consider the language $${L_1}$$ (over alphabet $$0$$) accepted by the following automaton.

The order of $${L_1}$$ is _____.
General Aptitude
The word that best fills the blank in the above sentence is

The words that best fill the blanks in the above sentence are