GATE CSE

1) abaabaaabaa
2) aaaabaaaa
3) baaaaabaaaab
4) baaaaabaa
The ISP wants to give half of this chunk of addresses to Organization A, and a quarter to Organization B, while retaining the remaining with itself. Which of the following is a valid allocation of address to A and B?
The number of bit in the tag field of an address is
The size of the cache tag directory is
int height (treeptr n)
{ if (n== NULL) return -1;
if (n-> left == NULL)
if (n-> right ==NULL) return 0;
else return B1 ; // Box 1
else {h1 = height (n -> left);
if (n -> right == NULL) return (1 + h1);
else {h2 = height (n -> right);
return B2 ; // Box 2
}
}
}
The appropriate expression for the two boxes B1 and B2 are P: An SQL query can contain a HAVING clause even if it does not have a GROUP BY clause
Q: An SQL query can contain a HAVING clause only if it has a GROUP BY clause
R: All attributes used in the GROUP BY clause must appear in the SELECT clause
S: Not all attributes used in the GROUP BY clause need to appear in the SELECT clause
A
ID | Name | Age |
---|---|---|
12 | Arun | 60 |
15 | Shreya | 24 |
99 | Rohit | 11 |
B
ID | Name | Age |
---|---|---|
15 | Shreya | 24 |
25 | Hari | 40 |
98 | Rohit | 20 |
99 | Rohit | 11 |
C
ID | Phone | Area |
---|---|---|
10 | 2200 | 02 |
99 | 2100 | 01 |
How many tuples does the result of the following SQL query contain?
SELECT A.Id
FROM A
WHERE A.Age > ALL (SELECT B.Age
FROM B
WHERE B.Name = 'Arun')
A
ID | Name | Age |
---|---|---|
12 | Arun | 60 |
15 | Shreya | 24 |
99 | Rohit | 11 |
B
ID | Name | Age |
---|---|---|
15 | Shreya | 24 |
25 | Hari | 40 |
98 | Rohit | 20 |
99 | Rohit | 11 |
C
ID | Phone | Area |
---|---|---|
10 | 2200 | 02 |
99 | 2100 | 01 |
How many tuples does the result of the following relational algebra expression contain? Assume that the schema of A ∪ B is the same as that of A. $$(A\cup B)\bowtie _{A.Id > 40 \vee C.Id < 15} C$$
T1 : read (P) ;
read (Q) ;
if P = 0 then Q : = Q + 1 ;
write (Q).
T2 : read (Q) ;
read (P)
if Q = 0 then P : = P + 1 ;
write (P).
Any non-serial interleaving of T1 and T2 for concurrent execution leads to
Represents the Boolean function
The values of the cumulative distribution function F(x) at x = - 1 and + 1 are

$${{\rm I}_1}:$$ If it rains then the cricket match will not be played. The cricket match was played.
Inference: there was no rain.
$${{\rm I}_2}:$$ If it rains then the cricket match will not be played. It did not rain
Inference:the cricket match was played. which of the following is TRUE?
On a demand paged virtual memory system running on a computer system that has main memory size of $$3$$ page frames which are initially empty. Let $$LRU,$$ $$FIFO$$ and $$OPTIMAL$$ denote the number of page faults under the corresponding page replacement policy. Then
fork $$\left( {\,\,\,} \right);$$
fork $$\left( {\,\,\,} \right);$$
fork $$\left( {\,\,\,} \right);$$
The total number of child processes created is
Process | Arrival Time | Time Units Required |
---|---|---|
P1 | 0 | 5 |
P2 | 1 | 7 |
P3 | 3 | 4 |
The completion order of the $$3$$ processes under the policies $$FCFS$$ and $$RR2$$ (round robin scheduling with $$CPU$$ quantum of $$2$$ time units) are
AcquireLock(L){
While (Fetch_And_Add(L,1))
L = 1;
}
Release Lock(L){
L = 0;
}
This implementation int a, b, c = 0;
void prtFun(void);
main( )
{
static int a = 1; /* Line 1 */
prtFun();
a + = 1;
prtFun();
printf("\n %d %d ", a, b);
}
void prtFun(void)
{
static int a=2; /* Line 2 */
int b=1;
a+ = ++b;
printf("\n %d %d ", a, b);
}
What output will be generated by the given code segment?int a, b, c = 0;
void prtFun(void);
main( )
{
static int a = 1; /* Line 1 */
prtFun();
a + = 1;
prtFun();
printf("\n %d %d ", a, b);
}
void prtFun(void)
{
static int a=2; /* Line 2 */
int b=1;
a+ = ++b;
printf("\n %d %d ", a, b);
}
What output will be generated by the given code segment if:
Line 1 is replaced by auto int a = 1;
Line 2 is replaced by register int a = 2;
Char inchar = 'A';
Switch ( inchar ) {
case 'A' : printf ("Choice A\ n") ;
case 'B' :
case 'C' : printf (“Choice B”) ;
case 'D' :
case 'E' :
default : printf ( " No Choice" ) ; }
Program main;
Var . . .
Procedure A1;
Var . . .
Call A2;
End A1
Procedure A2;
Var . . .
Procedure A21;
Var . . .
Call A1;
End A21
Call A21;
End A2
Call A1;
End main.
Consider the calling chain: Main $$ \to $$ A1 $$ \to $$ A2 $$ \to $$ A21 $$ \to $$ A1
The correct set of activation records along with their access links is given by
The missing arcs in the $$DFA$$ are

Assume $$\sum { = \left\{ a \right\}\,\,} $$ and $$\varepsilon $$ is the empty string.

$$1.$$ Does a given program ever produce an output?
$$2.$$ If L is a context-free language, then, is $$\overline L $$ also context-free?
$$3.$$ If L is a regular language, then, is $$\overline L $$ also regular?
$$4.$$ If L is a recursive language, then, is $$\overline L $$ also recursive?