Question 3Asked in UGC NET Computer Science, June 2014 (Paper II & III, Selected Questions)

Mergesort makes two recursive calls. Which statement is true after these two recursive calls finish, but before the merge step?

  1. AThe array elements form a heap.
  2. BElements in each half of the array are sorted amongst themselves.
  3. CElements in the first half of the array are less than or equal to elements in second half of the array.
  4. DAll of the above
Show answerHide answer

Correct answer: (B) Elements in each half of the array are sorted amongst themselves.

Explanation

After the two recursive calls in Mergesort complete, but before the merge step, elements in each half of the array are sorted amongst themselves because, Mergesort is possible when two arrays are sorted. If two unsorted arrays are submitted to Mergesort algorithm. It will sort each of them first before merging them, because Mergesort is a divide and conquer algorithm, Hence the answer is option (b).

From UGC NET Computer Science PYQ, June 2014 (Paper II & III, Selected Questions)

This is question 3 of UGC NET Computer Science PYQ, June 2014 (Paper II & III, Selected Questions). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.