Question: ONLY THE WORD EXPLANATION NEEDED NO CODE PLEASE. Also include PSEUDOCODE - ( pointers are not allowed ) You are consulting for an oil company,

ONLY THE WORD EXPLANATION NEEDED NO CODE PLEASE. Also include PSEUDOCODE -(pointers are not allowed)
You are consulting for an oil company, which is planning a large
pipeline (called the huge pipeline) running horizontally from east to west through an oil field of n wells. From each well, a spur pipeline is to be connected directly to the main pipeline along a shortest path (going to either the north or the south). Suppose that there are n wells, represented by n points p1, p2,..., pn in the plane. We are given the x- and y-coordinates of the n wells pi =(xi, yi) for i =1,2,3,.., n. Note that the wells are not given in any sorted order. Our goal is to pick an optimal location for the main pipeline (i.e., find the y-coordinate of the main pipeline) such that the total sum of the lengths of the spur pipelines is minimized. For simplicity, we assume that no two wells have the same x-coordinate or y-coordinate.
Design an O(n) time algorithm to compute an optimal location for the main pipeline. The answer is not the median of the sorted y-coordinates
 ONLY THE WORD EXPLANATION NEEDED NO CODE PLEASE. Also include PSEUDOCODE

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!