Given a list of numbers, we want to sort them in increasing order:

  • Divide the problem into smaller parts
  • Why not two parts, and roughly equal parts ?
  • How to combine two smaller sorted lists into a final solution ?

Algorithm

  • The time needed to combine and to obtain is
  • Hence, the recurrence is
  • You can check that satisfies this recurrence

Can we do better by splitting into 3 sub-problems instead of 2?

An alternative algorithm to sort a given list, which takes an approach very similar to that of , is the following:

  • Split the given list having elements into three lists (instead of just two lists) having elements each.
  • Recursively sort each of three lists
  • Combination can still be done in time using an approach similar to that above.