GATE CSE 2026 Session 2 Q32: Number of 'void' merges in merge sort of an 8-element array
- Algorithms
- 1 mark
- NAT
- No negative marking
Question
Consider an array . Suppose the merge sort algorithm is executed on array to sort it in increasing order. The merge sort algorithm will carry out a total of 7 merge operations.
A merge operation on sorted left array and sorted right array is said to be void if the output of the merge operation is the elements of array followed by the elements of array .
The number of void merge operations among these 7 merge operations is __________. (answer in integer)
Try it: numerical answer: type the value
Show answer and explanation
Answer: 3 (official GATE 2026 final answer key)
Concept used: A merge is void exactly when the largest element of is smaller than the smallest element of .
First step: Write out the merge tree: four merges of pairs, two of 4-element halves, and the final merge; test each.
Full step-by-step solution
Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.
Share this question
Source: official GATE 2026 Session 2 CS question paper and final answer key, organised by IIT Guwahati. Question paper · Answer key
More Algorithms PYQs
- 2026 Session 1 · Q17Solve nested recurrences T1 = 4T1(n/2) + T2, T2 = 5T2(n/4) + log n
- 2026 Session 1 · Q41Shortest paths with at most k edges: two statements
- 2026 Session 1 · Q47Condition forcing a vertex into every minimum vertex cover
- 2026 Session 1 · Q49Cycle and cut properties of MSTs with distinct weights
- 2026 Session 1 · Q50Impossible DFS discovery/finish orderings for a DAG edge
- 2026 Session 1 · Q55Properties of 2-colorable (bipartite) graphs