Divide and Conquer Algorithm

Summary

AlgorithmDivide StepConquer StepCombine StepTime Complexity
Merge SortSplit array into halvesRecursively sort each halfMerge sorted halvesO(n log n)
Quick SortPartition array around a pivotRecursively sort left and rightNo additional work neededO(n log n) avg, O(n^2) worst
Binary SearchFind middle elementRecursively search left or right halfDirectly return resultO(log n)
Median FindingDivide into groups of 5Find median of mediansUse median for selectionO(n)
Matrix MultiplicationPartition matrix into quadrantsCompute seven matrix productsReconstruct final matrixO(n^{2.81}) (Strassen’s)

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top