GATE CS 2026 Set 2 | Question 32
Algorithms › Sorting & Searching · NAT · 1 mark · Answer: 3
- Question 32Algorithmsnat1 markConsider 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)
Answer: 3
Solution
A merge is void when . The 7 merges are:merge(10,7)→no;merge(8,19)→void;merge([7,10],[8,19])→no (10>8);merge(41,35)→no;merge(25,31)→void;merge([35,41],[25,31])→no; finalmerge([7,8,10,19],[25,31,35,41])→void (19≤25). Void merges .
More GATE PYQ on Sorting & Searching
All GATE CS Algorithms PYQ →Attempt GATE CS 2026 Set 2 in real GATE exam mode
Full paper with a timer, the GATE interface and a topic-wise analysis — free.
Create free account →