diff --git a/Closest Pair/README.markdown b/Closest Pair/README.markdown index 57786c7ff..35ea15653 100644 --- a/Closest Pair/README.markdown +++ b/Closest Pair/README.markdown @@ -2,7 +2,7 @@ Closest Pair is an algorithm that finds the closest pair of a given array of points By utilizing the Divide and Conquer methodology of solving problems so that it reaches the correct solution with O(nlogn) complexity. -![Given points and we're required to find the two red ones](../Closest Pair/Images/1200px-Closest_pair_of_points.png) +![Given points and we're required to find the two red ones](Closest Pair/Images/1200px-Closest_pair_of_points.png) As we see in the above image there are an array of points and we need to find the closest two, But how do we do that without having to compare each two points which results in a whopping O(n^2) complexity? @@ -26,7 +26,7 @@ let line:Double = (p[mid].x + p[mid+1].x)/2 and just recursively calls itself until it reaches the base case we don't detect those points. -![ Points lying near the division line](../Closest Pair/Images/Case.png) +![ Points lying near the division line](Closest Pair/Images/Case.png) - To solve this we start by sorting the array on the Y-axis to get the points in their natural order and then we start getting the difference between the X position of the point and the line we drew to divide and if it is less than the min we got so far from the recursion we add it to the strip @@ -46,7 +46,7 @@ while i