Divide and Conquer
Divide and Conquer
By – S h a s hwat c h o u d h a r y
(RA2011003020466)
DIVIDE AND
CONQUER
L E T ’ S D I V E I N
2
What is Divide and conquer
algorithm?
Divide and conquer is an algorithm design paradigm. A divide-and-
conquer algorithm recursively breaks down a problem into two or
more sub-problems of the same or related type, until these become
simple enough to be solved directly. The solutions to the sub-
problems are then combined to give a solution to the original
problem.
3
How Divide and Conquer
Algorithms Work?
Here are the steps involved:
6
Advantages of Divide and Conquer
Algorithm
• The complexity for the multiplication of two matrices using the
naive method is O(n3), whereas using the divide and conquer
approach (i.e. Strassen's matrix multiplication) is O(n2.8074). This
approach also simplifies other problems, such as the Tower of
Hanoi.
• This approach is suitable for multiprocessing systems.
• It makes efficient use of memory caches.
7
Merge Sort
Merge sort is a sorting algorithm that works by dividing an array into
smaller subarrays, sorting each subarray, and then merging the sorted
subarrays back together to form the final sorted array.
In simple terms, we can say that the process of merge sort is to divide
the array into two halves, sort each half, and then merge the sorted
halves back together. This process is repeated until the entire array is
sorted
8
9
THANK YOU