GATE 2026
65 questions
MCQ 33 · MSQ 14 · NAT 181-mark 30 · 2-mark 35
Questions 31–35 of 65
Let A be a sorted array containing distinct integers. You perform a recursive binary search on to find an element . Suppose each comparison checks whether the middle element computed during the current recursive step is equal to, less than, or greater than .
The maximum number of comparisons that may have to be performed if is not an element of is ________. (Answer in integer)
The maximum number of comparisons that may have to be performed if is not an element of is ________. (Answer in integer)
Answer: 10
Binary search on distinct elements cuts the search space in half after every comparison. In the worst case, the number of comparisons needed is (or the same thing written as ).
Here, , so .
Answer: 10
Here, , so .
Answer: 10
In a relational database, a Tree Index is to be constructed for a relation on a key field. In a Tree, a Node Pointer points to a sub-tree and a Data Record Pointer points to a block of database records.
Let, Node size bytes, Node Pointer size bytes, Search Key Field size bytes and Data Record Pointer size bytes.
The maximum number of Node Pointers that can be present in a non-leaf node of the Tree is ________. (Answer in integer)
Let, Node size bytes, Node Pointer size bytes, Search Key Field size bytes and Data Record Pointer size bytes.
The maximum number of Node Pointers that can be present in a non-leaf node of the Tree is ________. (Answer in integer)
Answer: 195
Take a non-leaf node of a tree that holds node pointers. Along with them it stores key values. The whole node has to fit inside the node size:
The number of pointers must be a whole number, so we take the floor: .
Answer: 195
The number of pointers must be a whole number, so we take the floor: .
Answer: 195
The number of bijections from the set to itself such that , for all , is ________. (Answer in integer)
Answer: 10
We need bijections on that satisfy for every . These are involutions. An involution is a permutation that is its own inverse. It has only fixed points and disjoint -cycles (transpositions).
Count by the number of fixed points:
- fixed points (the identity): way.
- fixed points and transposition: pick the elements to fix in ways. The other elements then form the transposition by themselves. This gives ways.
- fixed points and disjoint transpositions: split elements into unordered pairs. This can be done in ways, namely .
Total:
Answer: 10
Count by the number of fixed points:
- fixed points (the identity): way.
- fixed points and transposition: pick the elements to fix in ways. The other elements then form the transposition by themselves. This gives ways.
- fixed points and disjoint transpositions: split elements into unordered pairs. This can be done in ways, namely .
Total:
Answer: 10
Let be an exponentially distributed random variable with mean . If , then the conditional probability is ________. (Rounded off to two decimal places)
Answer: 0.34 to 0.36
The exponential distribution has a special memoryless property: holds for any .
In this question, we get straight from the memoryless property. We do not need to know the exact value of .
Answer: 0.35
In this question, we get straight from the memoryless property. We do not need to know the exact value of .
Answer: 0.35
The value of is ________. (Answer in integer)
Answer: 1
The double sum splits into two separate geometric series that multiply together:
First series: , and second series:
Multiply them:
Answer: 1
First series: , and second series:
Multiply them:
Answer: 1