1
GATE CSE 2020
MCQ (Single Correct Answer)
+1
-0.33
Consider allocation of memory to a new process. Assume that none of the existing holes in the memory will exactly fit the process's memory requirement. Hence, a new hole of smaller size will be created if allocation is made in any of the existing holes. Which one of the following statements is TRUE?
A
The hole created by worst fit is always larger than the hole created by first fit.
B
The hole created by best fit is never larger than the hole created by first fit.
C
The hole created by first fit is always larger than the hole created by next fit.
D
The hole created by next fit is never larger than the hole created by best fit.
2
GATE CSE 2020
Numerical
+2
-0
Consider the following C functions.
int tob(int b, int* arr) {
     int i;
     for (i=0; b>0; i++) {
           if (b%2) arr[i] = 1;
           else arr[i]=0;
           b = b/2;
    }
    return (i);
}

____________________
int pp(int a, int b) {
     int arr[20];
     int i, tot = 1, ex, len;
     ex = a;
     len = tob (b, arr);
     for (i=0;  i < len; i++) {
           if (arr[i] ==1)
              tot = tot * ex;
           ex = ex * ex;
    }
    return (tot);
}

The value returned by pp (3, 4) is ________.
Your input ____
3
GATE CSE 2020
Numerical
+2
-0
Consider the following C functions.
int fun1 (int n) {
     static int i = 0;
     if (n > 0) {
            ++i;
            fun1(n-1);
     }
     return (i);
}

___________________
int fun2 (int n) {
     static int i = 0;
     if (n > 0) {
            i = i + fun1 (n);
            fun2(n-1);
     }
     return (i);
}

The return value of fun2 (5) is _______.
Your input ____
4
GATE CSE 2020
MCQ (Single Correct Answer)
+2
-0.67

Consider the following languages.

L1 = {wxyx | w, x, y ∈ (0 + 1)+}

L2 = {xy | x, y ∈ (a + b)*, |x| = |y|, x ≠ y}

Which one of the following is TRUE?

A
L1 is regular and L2 is context-free.
B
L1 is context-free but not regular and L2 is context-free.
C
Neither L1 nor L2 is context-free.
D
L1 is context-free but L2 is not context-free.
EXAM MAP
Medical
NEETAIIMS
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
Civil Services
UPSC Civil Service
Defence
NDA
Staff Selection Commission
SSC CGL Tier I
CBSE
Class 12