CS and IT GATE 2025 SET-1 Questions with Answer

Ques 53 Operating Systems


A disk of size 512M bytes is divided into blocks of 64K bytes. A file is stored in the disk using linked allocation. In linked allocation, each data block reserves 4 bytes to store the pointer to the next data block. The link part of the last data block contains a NULL pointer (also of 4 bytes). Suppose a file of 1M bytes needs to be stored in the disk. Assume, 1K=210 and 1M=220. The amount of space in bytes that will be wasted due to internal fragmentation is ______ (Answer in integer)



Ques 54 Operating Systems


In optimal page replacement algorithm, information about all future page references is available to the operating system (OS). A modification of the optimal page replacement algorithm is as follows:
The OS correctly predicts only up to next 4 page references (including the current page) at the time of allocating a frame to a page.
A process accesses the pages in the following order of page numbers:
1, 3, 2, 4, 2, 3, 1, 2, 4, 3, 1, 4.
If the system has three memory frames that are initially empty, the number of page faults that will occur during execution of the process is ______ (Answer in integer)



Ques 55 Probability


A box contains 5 coins: 4 regular coins and 1 fake coin. When a regular coin is tossed, the probability P(head)=0.5 and for a fake coin, P(head)=1. You pick a coin at random and toss it twice, and get two heads. The probability that the coin you have chosen is the fake coin is ______ (rounded off to two decimal places)



Ques 56 Probability


Consider a probability distribution given by the density function

The probability that x lies between 2 and 3, i.e., P(2 ≤ x ≤ 3) is ______ (rounded off to three decimal places)



Ques 57 Programming and Data Structures


The output of the given C program is ______ (Answer in integer)



Ques 58 Programming and Data Structures


The value printed by the given C program is ______ (Answer in integer)



Ques 59 Programming and Data Structures


Let LIST be a datatype for an implementation of linked list defined as follows:
typedef struct list {
int data;
struct list *next;
} LIST;
Suppose a program has created two linked lists, L1 and L2, whose contents are given in the figure below (code for creating L1 and L2 is not provided here). L1 contains 9 nodes, and L2 contains 7 nodes.

Consider the following C program segment that modifies the list L1. The number of nodes that will be there in L1 after the execution of the code segment is ______ (Answer in integer)



Ques 60 Programming and Data Structures


Consider the following C program:

The value printed by the given C program is ______ (Answer in integer)



Ques 61 Theory of Computation


Consider the following context-free grammar G, where S, A, and B are the variables (non-terminals), a and b are the terminal symbols, S is the start variable, and the rules of G are described as:
S→aab|Abb
A→a|aA
B→b|bB
Which ONE of the languages L(G) is accepted by G?

A

L(G)={a2bn|n≥1}∪{anb2|n≥1}

B

L(G)={anb2n|n≥1}∪{a2nbn|n≥1}

C

L(G)={anbn|n≥1}

D

L(G)={a2nb2n|n≥1}



Ques 62 Theory of Computation


A regular language L is accepted by a non-deterministic finite automaton (NFA) with n states. Which of the following statement(s) is/are FALSE?

A

L may have an accepting NFA with < n states.

B

L may have an accepting DFA with < n states.

C

There exists a DFA with ≤2n states that accepts L.

D

Every DFA that accepts L has >2n states.



Ques 63 Theory of Computation


Consider the following two languages over the alphabet {a, b}:
L1={αβα|α∈{a,b}+ AND β∈{a,b}+}
L2={αβα|α∈{a}+ AND β∈{a,b}+}
Which ONE of the following statements is CORRECT?

A

Both L1 and L2 are regular languages.

B

L1 is a regular language but L2 is not a regular language.

C

L1 is not a regular language but L2 is a regular language.

D

Neither L1 nor L2 is a regular language.



Ques 64 Theory of Computation


Consider the following two languages over the alphabet {a, b, c}, where m and n are natural numbers.
L1={ambmcm+n|m,n≥1}
L2={ambncm+n|m,n≥1}
Which ONE of the following statements is CORRECT?

A

Both L1 and L2 are context-free languages.

B

L1 is a context-free language but L2 is not a context-free language.

C

L1 is not a context-free language but L2 is a context-free language.

D

Neither L1 nor L2 are context-free languages.



Ques 65 Theory of Computation


Consider the following deterministic finite automaton (DFA) defined over the alphabet, Σ={a,b}. Identify which of the following language(s) is/are accepted by the given DFA.

A

The set of all strings containing an even number of b's.

B

The set of all strings containing the pattern bab.

C

The set of all strings ending with the pattern bab.

D

The set of all strings not containing the pattern aba.



Unique Visitor Count

Total Unique Visitors

Loading......