Questions tagged [divide-and-conquer]

Divide and conquer is an algorithm design paradigm based on recursion. A problem is broken down into multiple small subproblems until they are simple enough to be solved. The solutions are then combined to give a solution to the original problem.

Filter by
Sorted by
Tagged with
3
votes
1answer
146 views

Implementation of binary search

I am new to the divide and conquer paradigm. I wanted to verify that there's nothing wrong with this implementation of binary search. I ran it a few times and it does print the correct result, but I ...
4
votes
2answers
5k views

Finding the closest pair of points divide-and-conquer

Here is my code for the famous "finding the closest pair of points" problem from CLRS book section 33.4 using a divide-and-conquer approach (this code returns the minimum distance between pair of ...
2
votes
2answers
291 views

Finding the closest pair of points divide-and-conquer speed improvement

This is a follow up to a previously asked Finding the closest pair of points divide-and-conquer question . The original code changed significantly based on answers from @AJNeufeld therefore I created ...