Closed romanjoy closed 2 years ago
This involves dividing the problem into smaller sub-problems.
Solve sub-problems by calling recursively until solved.
Combine the sub-problems to get the final solution of the whole problem.
merge_sort (p...r) = merge(merge_sort (p...q), merge(q+1...r)) if (p>=r) over
Divide
This involves dividing the problem into smaller sub-problems.
Conquer
Solve sub-problems by calling recursively until solved.
Combine
Combine the sub-problems to get the final solution of the whole problem.
Merge Sort Process
Recursive Formula
merge_sort (p...r) = merge(merge_sort (p...q), merge(q+1...r)) if (p>=r) over