GATE Solved Paper 2020 - GATE 2020

24. 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 of the existing holes. Which one of the following statements is TRUE?

  • Option : A
  • Explanation :
    Let us consider a new process required 120 kb memory and existing holes in the memory are 200, 300, 150 kb as shown in the diagram in the same order.

    Now, when we allocate, this new process a memory using different algorithms, it would be like given below
    Algorithm Allocated partition size of new tube
    First Fit 200 KB 80 KB
    Best Fit 150 KB 30 KB
    Worst Fit 300 KB 180 KB
    Next Fit 300 KB 180 KB
Cancel reply
Cancel reply

25. Consider the following sentences.
I. If L1 ⋃ L2 is regular, then both L1 and L2 must be regular.
II. The class of regular languages is closed under infinite union.
Which of the above statements is/are TRUE?

  • Option : B
  • Explanation :
    Let L1 = an bn⇒ CFL
    L2 = Σ* ⇒ Regular
    L1 ∪ L2 = (an bn) ∪ Σ* = Σ* ⇒ Regular
    Since L1 ∪ L2 is regular but L1 is not regular, Hence statement I is false.
    Regular language is not closed under infinite union.
    Hence, statement-II is also false.
    ∴ Neither I nor II is true.
Cancel reply
Cancel reply