pair< double, pair> dq_closest_pair(
vector& sorted_points,
vector& y_sorted_points )
{
// if the size of sorted_points is less than BASE_CASE_NUM_POINTS,
// call naive_closest_pair( sorted_points ) instead.
// otherwise,
// find median point in sorted_points (point in the middle of the vector)
// let median point be p = (xp, yp). If all points have the
// same x coordinate, we must still split list in half, so we
// must sort points with the same x coordinate by their y
// coordinate. Implement operator< on points to do this.
//
// copy first half of sorted_points into left_sorted_points
// copy second half of sorted_points into right_sorted_points
/* Now select the points from y_sorted_points which are in
* left_sorted_points, by checking if their x coordinate in
* less than xp, or, if equal to xp, if their y coordinate is less.
* In other words, if a < p, using operator<. Select these points
* into a new vector, keeping the same order. Thus, these points
* remain sorted by their y coordinates. Call this new vector
* left_y_sorted_points.
*/
// Similarly, create right_y_sorted_points.
// Call dq_closest_pair( left_sorted_points, left_y_sorted_points ),
// and remember the return value.
// similarly, call dq_closest_pair() for the right half.
// Select the minimum distance from the calls to dq_closest_pair(),
// call it d.
// Create two new vectors from left_y_sorted_points and right_y_sorted_points,
// by selecting only those points with x coordinate > xp-d or < xp+d,
// respectively. Call these list_a and list_b. Iterate through list_a,
// keeping iterators
// pointing to points in list_b that are the beginning and end of the range
// in list_b that must be compared to the current point in list_a.
// These iterators in list_b will only move forward, as we move through
// list_a. Compare each point a = (xa, ya) in list_a to those points
// b = (xb,yb) in list_b such that ya - d < yb < ya+d. Find the
// distance between all these pairs, and if a distance is less than
// d, update d and the current best pair of points appropriately.
// If d changes, we don't need to go back and reselect list_a and list_b.
// Just keep searching the current lists until the end.
// Then return the shortest distance d and the best pair of points.
}