Tag Archives: divide and conquer

Closest pair of points problem in C++

Given n points, find two points with the smallest distance to each other. The examples listed below demonstrate two algorithms in C++ to tackle this problem. One algorithm simply checks every combination of points, also known as a brute force approach. The other one is an efficient algorithm which uses a divide and conquer approach.  The [...]

Posted in C++ | Also tagged , , , , , , , , , | 2 Comments

Quicksort algorithm in C#

Quicksort is a divide and conquer sorting algorithm. This example uses the quicksort algorithm to sort an array of string elements.

Posted in C# | Also tagged , , , , , , | 13 Comments