Topics in Data Structures

Filter by year

Data Structures questions

Q25

GATE DA 2026 DAData StructuresMSQ1 mark

Report a problem with Q25

What is wrong?
You are given the following Pre-order and In-order traversals of a Binary Tree T with nodes E, F, G, P, Q, R, S.
Pre-order: P Q S E R F G
In-order: S Q E P F R G
Which of the following statements is/are true about the Binary Tree T?
More than one option can be correct.
Show answer without attempting

Loading the answer…

Q39

GATE DA 2026 DAData StructuresMCQ2 marks−2/3 if wrong

Report a problem with Q39

What is wrong?
A recursive function in Python is given.
def mystery(n):
    if n <= 0:
        return 1
    else:
        return mystery(n-1) + mystery(n-2)
Now, consider the following function call:
mystery(4)
Assume that a typical runtime stack is used to manage function calls. Each function call is pushed onto the stack and removed only after it finishes execution.
Which of the following options denotes the total number of function calls (i.e., the total number of stack activations), including the initial call, to compute mystery(4)?
Show answer without attempting

Loading the answer…

0/20 correct0 marks

Related topics in Programming Data Structures and Algorithms