Divide And Conquer Algorithm
In computer science, divide and conquer (D&C) is an important algorithm design paradigm based on multi-branched recursion. A divide and conquer algorithm works by recursively breaking 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.
This technique is the basis of efficient algorithms for all kinds of problems, such as sorting (e.g., quicksort, merge sort), multiplying large numbers (e.g. Karatsuba), syntactic analysis (e.g., top-down parsers), and computing the discrete Fourier transform (FFTs).
On the other hand, the ability to understand and design D&C algorithms is a skill that takes time to master. As when proving a theorem by induction, it is often necessary to replace the original problem by a more general or complicated problem in order to get the recursion going, and there is no systematic method for finding the proper generalization.
The name "divide and conquer" is sometimes applied also to algorithms that reduce each problem to only one subproblem, such as the binary search algorithm for finding a record in a sorted list (or its analog in numerical computing, the bisection algorithm for root finding). These algorithms can be implemented more efficiently than general divide-and-conquer algorithms; in particular, if they use tail recursion, they can be converted into simple loops. Under this broad definition, however, every algorithm that uses recursion or loops could be regarded as a "divide and conquer algorithm". Therefore, some authors consider that the name "divide and conquer" should be used only when each problem may generate two or more subproblems. The name decrease and conquer has been proposed instead for the single-subproblem class.
The correctness of a divide and conquer algorithm is usually proved by mathematical induction, and its computational cost is often determined by solving recurrence relations.
Read more about Divide And Conquer Algorithm: Early Historical Examples
Famous quotes containing the words divide and, divide and/or conquer:
“The failure of academic feminists to recognize difference as a crucial strength is a failure to reach beyond the first patriarchal lesson. In our world, divide and conquer must become define and empower.”
—Audre Lorde (19341992)
“To have the fear of God before our eyes, and, in our mutual dealings with each other, to govern our actions by the eternal measures of right and wrong:MThe first of these will comprehend the duties of religion;Mthe second, those of morality, which are so inseparably connected together, that you cannot divide these two tables ... without breaking and mutually destroying them both.”
—Laurence Sterne (17131768)
“It was not reason that besieged Troy; it was not reason that sent forth the Saracen from the desert to conquer the world; that inspired the crusades; that instituted the monastic orders; it was not reason that produced the Jesuits; above all, it was not reason that created the French Revolution. Man is only great when he acts from the passions; never irresistible but when he appeals to the imagination.”
—Benjamin Disraeli (18041881)