When we are talking about divide and conquer ,we always use recursion .I've already known divide and conquer is a technique of algorithm design,but I got one question:
Are all divide and conquer algorithms recursion ,or put it another way ,is the thought of divide and conquer employed in all recursions?
I'm confused .
If I understand your problem correctly.. Are all Divide & Conquer algorithms recursive in nature? Yes!
By definition
There are three steps to applying Divide and Conquer algorithm in practice:
But if you are concerned with the implementation part.. then recursion(though more elegant and simple) is not the only way.
Binary Search is a well-known instance of divide-and-conquer paradigm and here is the Iterative implementation of the algorithm.
//binary search for x, in array A[1 .. N]
min := 1;
max := N;
repeat
mid := (min+max) div 2;
if x > A[mid] then
min := mid + 1;
else
max := mid - 1;
until (A[mid] = x) or (min > max);