DEV Community

Cover image for Which Sorting Algorithm is of Divide and Conquer Type
He Codes IT
He Codes IT

Posted on

Which Sorting Algorithm is of Divide and Conquer Type

In a Divide and Conquer Paradigm we divide the bigger problem into smaller sub problems and call the function recursively to solve the sub problems. Divide and Conquer method is more appropriate for those problems that have polynomial time solutions. Some of the Divide and Conquer Algorithms are Insertion sort, bubble sort, etc. Read this to know more about this algorithms HERE

Divide and Conquer Paradigm. 3 — Steps

Divide. Divide the bigger Problem into smaller sub problems.
Conquer. Solve the sub problems recursively, if the sub problem is very small then solve it in straight-forward manner.
Combine. combine all the solutions into the solutions of original problem.

Merge Sort
Problem: Given an array of size n, sort them in ascending order.

Visit to read more https://hecodesit.com/which-sorting-algorithm-is-of-divide-and-conquer-type/

Discussion (0)