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 [...]
Tag Archives: divide and conquer
Quicksort is a divide and conquer sorting algorithm. This example uses the quicksort algorithm to sort an array of string elements.