1
GATE CSE 2026 Set 1
Numerical
+1
-0

The height of a binary tree is the number of edges in the longest path from the root to a leaf in the tree. The maximum possible height of a full binary tree with 23 nodes is $\_\_\_\_$ . (answer in integer)

Your input ____
2
GATE CSE 2026 Set 1
MCQ (Single Correct Answer)
+2
-0

Consider the following code snippet in C language that computes the number of nodes in a non-empty singly linked list pointed to by the pointer variable head.

struct node{

    int elt;

    struct node *next;

};

int getListSize (struct node *head)

{

    if( E1 ) return 1;

    return E2;

}

Which one of the following options gives the correct replacements for the expressions E 1 and E 2 ?

A

E1: head == NULL

E2: 1 + getListSize(head)

B

E1: head → next == NULL

E2: $1+$ getListSize(head → next)

C

E1: head == NULL

E2: $1+$ getListSize(head → next)

D

E1: head → next == NULL

E2: 1 + getListSize(head)

3
GATE CSE 2026 Set 1
MCQ (Single Correct Answer)
+2
-0

Let $P$ be the set of all integers from 1 to 15 . Consider any order of insertion of the elements of $P$ into a binary search tree that creates a complete binary tree. Which one of the following elements can NEVER be the third element that is inserted?

GATE CSE 2026 Set 1 Data Structures - Trees Question 1 English
A

4

B

2

C

10

D

5

4
GATE CSE 2026 Set 1
MCQ (More than One Correct Answer)
+2
-0

Consider the following pseudocode for depth-first search (DFS) algorithm which takes a directed graph $G(V, E)$ as input, where $d[v]$ and $f[v]$ are the discovery time and finishing time, respectively, of the vertex $v \in V$.

DFS(G):
unmark all v ∈ V
t ← 0
for each v ∈ V
    if v is unmarked
        t ← Explore(G, v, t)
    end if
end for
Explore(G, v, t):
    mark v
    t ← t + 1
    d[v] ← t
    for each (v, w) ∈ E
        if w is unmarked
            t ← Explore(G, w, t)
        end if
    end for
    t ← t + 1
    f[v] ← t
    return t

Suppose that the input directed graph $G(V, E)$ is a directed acyclic graph (DAG). For an edge $(u, v) \in E$, which of the following options will NEVER be correct?

A

$d[u] < d[v] < f[v] < f[u]$

B

$d[v] < d[u] < f[u] < f[v]$

C

$d[v] < f[v] < d[u] < f[u]$

D

$d[u] < d[v] < f[u] < f[v]$