Theory
It’s an approach for solving a problem where we first divide our problem into different then solve all of them separately by using a recursive approach and then combine all solved parts to have our final result.
Note: Recursion and Divide and Conquer both are different, in Recursion we don’t actually divide our problem we just call our method internally and solve it using the stack data structure. In Divide and Conquer approach we divide our problem into sub–problems and then combine them to have a complete solution to our problem.
Examples of Divide and Conquer are: Quick Sort, Merge Sort, etc.
Comments