GATE CS 2026, set 2 · Question 32 · Algorithms · Numerical answer (NAT) · 1 mark · no negative marks

Consider an array A = [10, 7, 8, 19, 41, 35, 25, 31]. Suppose the merge sort algorithm is executed on array A 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 L and sorted right array R is said to be void if the output of the merge operation is the elements of array L followed by the elements of array R.
The number of void merge operations among these 7 merge operations is ______. ( answer in integer )

Answer

Answer 3

Answer from the official GATE CS 2026 answer key.

The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes