GATE 2026 (Session 1)
65 questions
MCQ 28 · MSQ 24 · NAT 131-mark 30 · 2-mark 35
Questions 21–25 of 65
Consider the following Boolean expression of a function :
Which of the following expressions is/are equivalent to ?
Which of the following expressions is/are equivalent to ?
One or more options are correct.
Answer: (A), (C)
Make the truth table for :
From the table, only when . So is the XNOR of and .
- (XNOR written as the complement of XOR) gives exactly this truth table.
- : if one input of XOR is complemented, the output flips. XOR then becomes XNOR, so this is also equal to .
- and are both the plain XOR, because complementing both inputs does not change XOR. This is the complement of , not itself.
Answer: and
From the table, only when . So is the XNOR of and .
- (XNOR written as the complement of XOR) gives exactly this truth table.
- : if one input of XOR is complemented, the output flips. XOR then becomes XNOR, so this is also equal to .
- and are both the plain XOR, because complementing both inputs does not change XOR. This is the complement of , not itself.
Answer: and
Consider the -bit signed integers and represented using the sign-magnitude form. The binary representations of and are as follows:
Which of the following operations to compute result(s) in an arithmetic overflow?
Which of the following operations to compute result(s) in an arithmetic overflow?
One or more options are correct.
Answer: (B), (C)
In 8-bit sign-magnitude form, bit 7 is the sign bit. Bits 6-0 hold the magnitude. The largest magnitude .
For : the sign bit (negative). The magnitude , so .
For : the sign bit (positive). The magnitude , so .
Overflow occurs when the magnitude of the true result is more than , that is, when it is outside :
- → inside the range, no overflow.
- → magnitude , overflow.
- → magnitude , overflow.
- → inside the range, no overflow.
Answer: Z = X - Y, and Z = -X + Y
For : the sign bit (negative). The magnitude , so .
For : the sign bit (positive). The magnitude , so .
Overflow occurs when the magnitude of the true result is more than , that is, when it is outside :
- → inside the range, no overflow.
- → magnitude , overflow.
- → magnitude , overflow.
- → inside the range, no overflow.
Answer: Z = X - Y, and Z = -X + Y
Let be an odd number greater than . Consider a binary minheap with elements stored in an array whose index starts from .
Which of the following indices of do/does NOT correspond to any leaf node of the minheap?
Which of the following indices of do/does NOT correspond to any leaf node of the minheap?
One or more options are correct.
Answer: (B), (C)
A binary heap is stored in a 1-indexed array with elements. Its leaf nodes (nodes with no children) are the indices from to .
When is odd, we get . So:
- Leaf indices run from to .
- Internal (non-leaf) indices run from to .
Now check each given index:
- : this is the first leaf index, so it is a leaf.
- : this is the last leaf, so it is a leaf.
- : this is the last internal node index, so it is NOT a leaf.
- : this is less than , so it is also an internal node and NOT a leaf.
Answer: indices (n-1)/2 and (n-3)/2 do NOT correspond to leaf nodes.
When is odd, we get . So:
- Leaf indices run from to .
- Internal (non-leaf) indices run from to .
Now check each given index:
- : this is the first leaf index, so it is a leaf.
- : this is the last leaf, so it is a leaf.
- : this is the last internal node index, so it is NOT a leaf.
- : this is less than , so it is also an internal node and NOT a leaf.
Answer: indices (n-1)/2 and (n-3)/2 do NOT correspond to leaf nodes.
Consider a hash table that is initially empty. The hash table is maintained using open addressing with linear probing. The hash function used is .
Consider the following sequence of insertions performed on :
Which of the following positions in the hash table is/are empty after these insertions are performed?
Consider the following sequence of insertions performed on :
Which of the following positions in the hash table is/are empty after these insertions are performed?
One or more options are correct.
Answer: (C)
The hash function is . The table size is , with indices from to . Collisions use linear probing.
Find the hash of each key. If the slot is taken, move to the next slot, wrapping around the table:
The table at the end: . The empty positions are .
Among the given choices (0, 10, 2, 1), only position 2 is empty. Positions 0, 1 and 10 are all filled.
Answer: Position 2
Find the hash of each key. If the slot is taken, move to the next slot, wrapping around the table:
The table at the end: . The empty positions are .
Among the given choices (0, 10, 2, 1), only position 2 is empty. Positions 0, 1 and 10 are all filled.
Answer: Position 2
Consider the following grammar where is the start symbol, and and are terminal symbols.
Which of the following statements is/are true?
Which of the following statements is/are true?
One or more options are correct.
Answer: (A), (B), (C)
The grammar is .
(B) and (A): the string starts with , so it must use and . There are two ways:
- , (where );
- , .
These are two different parse trees, so has two distinct derivations and the grammar is ambiguous.
(C): starts with , so and . Try the choices for :
- : then , so , which works ( with both empty).
- : the next symbol must be , but it is .
- : cannot be derived, because every must be followed later by a .
- : nothing is left for the .
So the parse tree is unique, and so is the rightmost derivation.
(D): the language is context-free, and membership in a context-free language is decidable. So the language is not undecidable.
Answer: (A), (B), (C)
(B) and (A): the string starts with , so it must use and . There are two ways:
- , (where );
- , .
These are two different parse trees, so has two distinct derivations and the grammar is ambiguous.
(C): starts with , so and . Try the choices for :
- : then , so , which works ( with both empty).
- : the next symbol must be , but it is .
- : cannot be derived, because every must be followed later by a .
- : nothing is left for the .
So the parse tree is unique, and so is the rightmost derivation.
(D): the language is context-free, and membership in a context-free language is decidable. So the language is not undecidable.
Answer: (A), (B), (C)