Mergesort makes two recursive calls. Which statement is true after these two recursive calls finish, but before the merge step ?
UGC NET - 2014,
Answer: B
After the two recursive calls and before the merge, the elements in each half of the array are sorted among themselves. Mergesort sorts the left half and the right half separately and then merges them, so at this point each half is in order, but there is no relation between the halves, so the first half need not be smaller than the second and the array does not form a heap. The statement that all of them hold is therefore false. The merge step then combines the two sorted halves into one, and it is only after that step that the whole array is in order.
Please log in or register to report this question.