Divide and Conquer paradigm

Divide and conquer is just one of several powerful techniques for algorithm design, which often leads to efficient algorithms. These algorithms can generally be easily analyzed using recurrences and the Master Theorem. A general DandC algorithm is built by:

  1. Divide problem in sub-problems
  2. Conquer sub-problems
  3. Combine sub-problems to solve the main problem

Merge Sort

Merge Sort is the typical example of D&C algorithms.
Note that the number of subproblems are 2, is the size of each subproblem and is the work necessary to combine the subproblems (merge part of the algorithm). We can solve this using the master theorem (case 2 of master theorem): .

  1. Divide problem in sub-problem cutting in the middle element of the array
  2. Conquer sub-problems
  3. Combine sub-problems to solve the main problem, in this case because we have to combine nothing

undefined

So the complexity is:

Using Master theorem, case 1:

The number may not seem much smaller than 3, but because the difference is in the exponent, the impact on running time is significant. In fact, Strassen’s algorithm beats the ordinary algorithm on today’s machines for or so.

VLSI Layout

Embed a complete binary tree with leaves in a grid using minimal area.

where and using respectively the second and first case of MT. So we obtain a total complexity (area) of that can be improved using this new arrangement :

This new solution based on Divide and Conquer has a total complexity of obtained by where which is using the MT (first case).