GATE 2025 (Session 1) Computer Science and Information Technology (CS) Questions with Solutions

GATE 2025 (Session 1)

65 questions

MCQ 30 · MSQ 13 · NAT 221-mark 30 · 2-mark 35

Questions 31–35 of 65

Q31Limits, Continuity and Differentiability1 markNAT
Consider the given function f(x)f(x).

f(x)={ax+bfor x<1x3+x2+1for x≥1f(x) = \begin{cases} ax + b & \text{for } x < 1 \\ x^3 + x^2 + 1 & \text{for } x \geq 1 \end{cases}

If the function is differentiable everywhere, the value of bb must be ________. (rounded off to one decimal place)

Q32Probability Theory1 markNAT
A box contains 5 coins: 4 regular coins and 1 fake coin. When a regular coin is tossed, the probability P(head)=0.5P(\text{head}) = 0.5 and for a fake coin, P(head)=1P(\text{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)

Q33Array and Pointer1 markNAT
The pseudocode of a function fun() is given below:

fun(int A[0,...,n-1])
{
    for i=0 to n-2
	for j=0 to n-i-2
	    if (A[j] > A[j+1])
		then swap A[j] and A[j+1]
}
Let A[0,…,29]A[0, \dots, 29] be an array storing 30 distinct integers in descending order. The number of swap operations that will be performed, if the function fun() is called with A[0,…,29]A[0, \dots, 29] as argument, is __________. (Answer in integer)

Q34Array and Pointer1 markNAT

#include <stdio.h>
void foo(int *p, int x) {
    *p = x;
}

int main() {
    int *z;
    int a = 20, b = 25;
    z = &a;
    foo(z, b);
    printf("%d", a);
    return 0;
}
The output of the given C program is __________. (Answer in integer)

Q35Heap Tree1 markNAT
The height of any rooted tree is defined as the maximum number of edges in the path from the root node to any leaf node. Suppose a Min-Heap TT stores 32 keys. The height of TT is _____________. (Answer in integer)