How many passes will be needed to sort an array which contains 5 elements using Merge Sort
Answers
Answered by
1
Answer:
Like QuickSort, Merge Sort is a Divide and Conquer algorithm. It divides input array in two halves, calls itself for the two halves and then merges the two sorted halves. The merge() function is used for merging two halves. The merge(arr, l, m, r) is key process that assumes that arr[l..m] and arr[m+1..r] are sorted and merges the two sorted sub-arrays into one. See following C implementation for details.
Similar questions
Science,
4 months ago
Physics,
4 months ago
Computer Science,
4 months ago
Social Sciences,
8 months ago
Math,
8 months ago
Math,
1 year ago