Merge-sort (1)
Idea for sorting an array:
- Divide the array into two subarrays of about equal length.
- Sort the subarrays separately.
- Merge the sorted subarrays.
This is an application of the divide-and-conquer strategy. To solve a “hard” problem:
- Break the problem down into two or more “easier” sub-problems.
- Solve these sub-problems separately.
- Combine their answers.