Time Left - 25:00 mins

GATE 2022 Rapid Revision Weekly Quiz 5

Attempt now to get your rank among 119 students!

Question 1

Consider the following function, to which a pointer to the root node of the binary tree T is passed.

int ByjusEP (Struct Node * root)

{

int a = 0, b = 0, c = 0;

if(root == NULL) return 0;

if(root left == NULL && root right == NULL) return 1;

a = ByjusEP (root left);

b = ByjusEP (root right);

c = 1 + max(a, b);

return c;

}

What does the above program compute?

Question 2

If webpage "www.ByjusEP.co" which has 10 objects is requested, then how many port number is to be requested ________ ?

Question 3

Let the number of times the processor need to refer to memory when it fetches and executes an indirect-address-mode instruction if the instruction is the computation requiring a single operand be x and if the instruction is the computation requiring a branch be y. Then find the value of x+y _____ .

Question 4Multiple Correct Options

Consider the following languages:

L1 = | n is a positive integer}

L2 = {anb2ncn | n ≥ 0}

L3 = {anbmcm+k | n, m, k > 0}

L4 = {(an)m bn | n, m ≥ 1}

Which of the following is/are CORRECT?

Question 5

Consider the following system snapshot:

Which of the process will finish last?

Question 6

Consider a B+ tree in which the search key is 12 bytes long, block size is 1024 bytes, record pointer is 10 bytes long and block pointer is 8 bytes long. The maximum number of keys that can be accommodated in each non-leaf node of the tree is___________.

Question 7

Let a, b, c, d, e, f are the Boolean variable and F is the Boolean function such that F = a xor b xor c xor d xor e xor f. For how many different inputs of a, b, c, d, e, f, the function F takes the value 1 _____________?

Question 8

What is the value printed by the following C program?
#include<stdio.h>
int fun(int *a , int n)
{
     if(n<=0)
        return 0;
     else if(*a % 3 != 0)
   {
        return *a + f(a+1,n-1);
   }
     else
   {
        return *a - f(a+1,n-1);
   }
}

int main()
{
     int a[]= {12,4,5,6,15};
     printf(“%d”,fun(a,5));
     return 0;
}

Question 9

The number of positive divisors which divides either 2700 or 9000 are _________.

Question 10

Which of the following are decidable?
I. Whether the intersection of two regular languages is infinite.
II. Whether a given context–free language is regular
III. Whether two push–down automata accept the same language
IV. Whether a given grammar is context–free

Question 11

If two functions α and β, never take logic ‘0’ value at the same time then

Question 12

Consider the following SDT
GA-T{G.x=A.x-T.x}
AEa{A.x=E.x*2}
EEb{E1.x=1+E2.x}
E{E.x=-1}
TEb(T.x=Ex-2}
If above SDT uses L- attributed definition then what is the value of an attribute x at root after evaluation for an input string “ba-bb”.
  • 119 attempts
  • 0 upvotes
  • 1 comment
Sep 9GATE & PSU CS