Find the closest pair through the subarrays

Assignment Help Basic Computer Science
Reference no: EM132440462

Assume a straight line that is parallel to the X-axis contains points. Give a Divide-and-Conquer algorithm that finds the distance between the closest pair of points on the straight line. Please analyze the algorithm.

So far this is what I have:

Algorithm:

ClosestPair(P)

Input: An array P[] of n >= 2 points on a line in the Cartesian plane that is parallel to the X-axis. All points have y=2.

Output: The distance between the two closest points

1. Take P[n/2] as the middle point

2. Create subarray Pl for points P[0] to P[n/2] and another subarray Pr for P[n/2+1] to P[n-1]

3. Make recursive call to dl(Pl) and dr(Pr)

4. Find minimum of dl and dr and make it d

From this point, I need to find out how to find the closest pair through the subarrays. Any ideas?

Reference no: EM132440462

Questions Cloud

What exactly is a drug : What, exactly, is a "drug?" Given that definition,how do you feel about the morality of drug use Under what circumstances do you think it is morally permissible
Building code for specific features and functionality : For most applications, a team of developers works together building code for specific features and functionality.
Steal equipment or plant network monitoring devices : After reading the article "Don't Include Social Engineering in Penetration Tests," discuss whether social engineering should be included as part
What did think when the murderer was revealed : What did you think when the murderer was revealed? Were you shocked? If not, when did you first suspect that this person was the killer.
Find the closest pair through the subarrays : From this point, I need to find out how to find the closest pair through the subarrays. Any ideas?
Feasibility for the restaurant and proposed computer system : Describe how you would determine the technical, economic, legal, operational, and schedule feasibility for the restaurant and its proposed computer system
Analyze about Bengal Tiger : Analyze how they work with each other and organize Aristotle's six elements by the order of 'importance' to telling the story of Bengal Tiger
What is the difference between a bit and a byte : What is the difference between a bit and a byte and how do they work. 8 bits make one byte which will make only one character. What happens
ES985 - Operations Strategy for Industry Assignment : ES985 - Operations Strategy for Industry Assignment - IMA and PMA Discussion, Assessment Help and Solution, The University of Warwick, UK

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Implementation are necessary to deal with societal problems

"Policy-making and its subsequent implementation are necessary to deal with societal problems."

  Differences between an array

1. What are the main differences between an array and a C++ vector? 2. How are vector iterators similar to array indexes?

  Managing organizational risk

No longer than a decade ago, IT security professionals had to work hard to persuade organizational leaders about the importance of developing effective risk management plans. Nowadays, due to the plethora of cautionary tales that organizations histor..

  The pros and cons of three types of user interfaces

Examine the ease of use and the pros and cons of three (3) types of user interfaces available to the user today.

  Find the minimum-size edge cover for g

An edge cover of an undirected graph G = (V,E) is a set of edges such that each vertex in the graph is incident to at least one edge from the set. Give an efficient algorithm, based on matching, to find the minimum-size edge cover for G.

  System of linear equations and solving the system

Find the numbers by setting up a system of linear equations and solving the system using the elimination method.

  Combining multiple anomaly detection techniques

Discuss techniques for combining multiple anomaly detection techniques to improve the identification of anomalous objects.

  Firm offerings for maximum market penetration

What does this equation really mean about optimizing a firm's offerings for maximum market penetration? Be sure to properly use the terms in the question.

  Six economic goals discussed in section

Review the six economic goals discussed in this section. Then, in a paragraph of at least five sentences, describe the goal you feel is the most important to a country and explain why you feel this way. Be sure to provide at least two logical reas..

  Research its management style from its inception until

Microsoft just announced they are laying off 80,000 employees; Youtube was purchased by Google in 2006 and didn't turn a profit until 2010; and JC Penney changed CEOs and marketing strategies twice in a short span in the late 2000s. You need to..

  Compute the cost of sorting the relation in seconds

Suppose a flash storage device is used instead of disk, and it has a seek time of 1 microsecond and a transfer rate of 40 MB per second. Recompute the cost of sorting the relation in seconds with.

  What are some of the key environmental variables

What are some of the key environmental variables that are changing communication strategies in the business world today? Please give personal examples and back you comments with research form sources.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd