• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

Sudo GATE 2020 Mock III (24 January 2019)

Question 41

Consider a RISC pipeline having 5 stages, Find how many cycles are required for the instruction given below, assume operand forwarding, branch prediction is used in which the branch is not taken, ACS is the branch instruction and the five stages are Instruction fetch, Decode, Execute, Memory and Write back.
I1: ACS R0, R1,X
I2: LOAD R2, 0(R3)
I3: SUB R4 R2, R2
I4: X: ADD R5, R1, R2
I5: LOAD R1, 0(R5)
I6: SUB R1, R1, R4
I7: ADD R1, R1, R5 
  • 11
  • 12
  • 13
  • 14

Question 42

Consider the following C program:
#include<stdio.h>

int main()
{
          int m = 10;
          int n, n1;
          n = m++;
          n1 = ++m;
          n--;
          --n1;
          n -= n1;
          printf("%d",n);
          return 0;
} 
The output of the program is ______.
  • 0
  • 1
  • -2
  • None of these.

Question 43

Consider a network path with three links.
Link 1 – Speed : 10 Gbps, Propagation Delay : 40ms
Link 2 – Speed : 2 Gbps, Propagation Delay : 5ms
Link 3 – Speed : 2 Gbps, Propagation Delay : 10ms 
Assume processing delay to be zero. A data packet of 500 KB is sent from a source to a destination via the path:
link 1 – link 3 – link 2 
What is the total delay in transmitting the packet ?
  • 54.90 ms
  • 50.20 ms
  • 55.55 ms
  • 59.40 ms

Question 44

Consider the given shift register which takes serial input and parallel output is tapped from it, assume that the initial values of [Q0Q1Q2Q3] is[1110] . After which clock pulse the initial pattern becomes [1001] ?
  • 4
  • 5
  • 6
  • 7

Question 45

The pre-order traversal of a binary tree is given by,

12, 8, 6, 2, 7, 9, 10, 16, 15, 19, 17, 20 

Then the post-order traversal of this tree is:

  • 2, 6, 7, 8, 9, 10, 12, 15, 16, 17, 19, 20

  • 2, 7, 6, 10, 9, 8, 15, 17, 20, 19, 16, 12

  • 7, 2, 6, 8, 9, 10, 20, 17, 19, 15, 16, 12

  • Data not sufficient.

Question 46

For the processes listed in the following table, which of the following scheduling schemes will give the highest average turnaround time?
Process    Arrival Time    Processing Time
  A              0              3
  B              1              6
  C              4              4
  D              6              2 
  • First Come First Serve
  • Non-preemptive Shortest Job First
  • Shortest Remaining Time
  • Round Robin with Quantum value two

Question 47

The output of following C program is C
#include &lt;stdio.h&gt;
char str1[100];

char *fun(char str[])
{
    static int i = 0;
    if (*str)
    {
        fun(str+1);
        str1[i] = *str;
        i++;
    }
    return str1;
}

int main()
{
    char str[] = \"GATE CS 2015 Mock Test\";
    printf(\"%s\", fun(str));
    return 0;
}
  • GATE CS 2015 Mock Test
  • tseT kcoM 5102 SC ETAG
  • Segmentation Fault
  • tseT

Question 48

Consider the following languages.
L1 = {w1aw2 | w1,w2 ∈ {a,b}* , |w1|=2,|w2|≥3}
L2 = {ambn ∣ m≥n, n≥0}
L3 = {ambn ∣ m≥0, n≥0}
L4 = {ambnam ∣ m≥0, n≥0} 
Which of the following are NOT Regular ?
  • Only L1 and L2
  • Only L1 and L3
  • Only L2 and L3
  • None of these

Question 49

What is the time complexity of following function fun()? Assume that log(x) returns log value in base 2.
void fun() 
{ 
   int i, j; 
   for (i=1; i<=n; i++) 
      for (j=1; j<=log(i); j++) 
         printf("GeeksforGeeks"); 
} 
  • Θ(n)
  • Θ(n log log n)
  • Θ(n log n)
  • Θ(n^2)

Question 50

Which of the following language is Recursive Enumerable but not recursive ?
  • {<M> | M is a TM and there exists an input on which M halts in less than |<M>| steps}
  • {<M>| M is a TM and |L(M)| ≤ 3}
  • {<M>| M is a TM and |L(M)| ≥ 3}
  • {<M>| M is a TM that accepts all even numbers}

There are 65 questions to complete.

Last Updated :
Take a part in the ongoing discussion