CS and IT GATE 2016 Set-2 Questions with Answer

Ques 14 Automata


Consider the following types of languages:

L1 Regular,
L2: Context-free,
L3: Recursive,
L4: Recursively enumerable.

Which of the following is/are TRUE?

I. L3' U L4 is recursively enumerable
II. L2 U L3 is recursive
III. L1* U L2 is context-free
IV. L1 U L2' is context-free

A

I only

B

I and III only

C

I and IV only

D

I, II and III only



Ques 15 Automata


Language L1 is defined by the grammar:
S1 -> aS1b | ε
Language L2 is defined by the grammar:
S2 -> abS2 | ε
Consider the following statements:

P: L1 is regular
Q: L2 is regular

Which one of the following is TRUE?

A

Both P and Q are true

B

P is true and Q is false

C

P is false and Q is true

D

Both P and Q are false



Ques 16 C Programming


Consider the following program:

int f(int *p, int n)
{
    if (n <= 1) return 0;
    else return max(f(p+1,n-1),p[0]-p[1]);
}
int main()
{
    int a[] = {3,5,2,6,4};
    printf("%d", f(a,5));
}


Note: max(x,y) returns the maximum of x and y.

The value printed by this program is_________-


a is the correct answer.


Ques 17 C Programming


The value printed by the following program is____________

void f(int* p, int m)
{
    m = m + 5;
    *p = *p + m;
    return;
}
void main()
{
    int i=5, j=10;
    f(&i, j);
    printf("%d", i+j);
}


a is the correct answer.


Ques 18 C Programming


The following function computes XY for positive integers X and Y.

int exp(int X, int Y)
{
    int res = 1, a = X, b = Y;
    while ( b != 0 )
    {
        if ( b%2 == 0)
        {
            a = a*a;
            b = b/2;
        }
        else
        {
            res = res*a;
            b = b-1;
        }
    }
    return res;
}

Which one of the following conditions is TRUE before every iteration of the loop

A

XY= ab

B

(res ∗ a) Y = (res ∗ X) b

C

XY = res ∗ ab

D

XY = (res ∗ a) b



Ques 19 COA


Consider a 3 GHz (gigahertz) processor with a three-stage pipeline and stage latencies τ1, τ2, and τ3 such that τ1 = 3τ2/4 = 2τ3. If the longest pipeline stage is split into two pipeline stages of equal latency, the new frequency is _________ GHz, ignoring delays in the pipeline registers.


a is the correct answer.


Ques 20 COA


Suppose the functions F and G can be computed in 5 and 3 nanoseconds by functional units UF and UG , respectively. Given two instances of UF and two instances of UG , it is required to implement the computation F(G(Xi )) for 1 <= i <= 10. ignoring all other delays, the minimum time required to complete this computation is ________________ nanoseconds


a is the correct answer.


Ques 21 COA


A processor has 40 distinct instructions and 24 general purpose registers. A 32-bit instruction word has an opcode, two register operands and an immediate operand. The number of bits available for the immediate operand field is ____________


a is the correct answer.


Ques 22 Compiler Design


Match the following

(P) Lexical analysis (i)Leftmost derivation
(Q) Top down parsing (ii) Type checking
(R) Semantic analysis (iii) Regular expressions
(S) Runtime environments (iv) Activation records

A

P ↔ i, Q ↔ ii, R ↔ iv, S ↔ iii

B

P ↔ iii, Q ↔ i, R ↔ ii, S ↔ iv

C

P ↔ ii, Q ↔ iii, R ↔ i, S ↔ iv

D

P ↔ iv, Q ↔ i, R ↔ ii, S ↔ iii



Ques 23 Computer Network


Consider a 128×103 bits/second satellite communication link with one-way propagation delay of 150 milliseconds. Selective retransmission (repeat) protocol is used on this link to send data with a frame size of 1 kilobyte. Neglect the transmission time of acknowledgment. The minimum number of bits required for the sequence number field to achieve 100% utilization is ___________


a is the correct answer.


Ques 24 Computer Network


A network has a data transmission bandwidth of 20 × 106 bits per second. It uses CSMA/CD in the MAC layer. The maximum signal propagation time from one node to another node is 40 microseconds. The minimum size of a frame in the network is _________


a is the correct answer.


Ques 25 Computer Network


For the IEEE 802.11 MAC protocol for wireless communication, which of the following statements is/are TRUE?

I. At least three non-overlapping channels are available for transmissions.
II. The RTS-CTS mechanism is used for collision detection.
III. Unicast frames are ACKed.

A

All I, II, and III

B

I and III only

C

II and III only

D

II only



Ques 26 Computer Network


Identify the correct sequence in which the following packets are transmitted on the network by a host when a browser requests a webpage from a remote server, assuming that the host has just been restarted.

A

HTTP GET request, DNS query, TCP SYN

B

DNS query, HTTP GET request, TCP SYN

C

DNS query, TCP SYN, HTTP GET request

D

TCP SYN, DNS query, HTTP GET request



Unique Visitor Count

Total Unique Visitors

Loading......