Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

The task is to implement closest pair algorithm. Along with the implementation in c++, I want two additional things.

Thing 1. Test the correctness of your algorithm in the following way:

Generate 100 random points in the square [0,10]×[0,10] (i.e., the square whose lower-left corner is (0,0) and whose upper-right corner is (10,10)), with the x- and y-coordinates being floats that are chosen randomly and independently.

Compute the minimum distance between these points using your implementation.

Rotate the points counterclockwise 90o around the origin by applying the transformation (x,y)?(-y,x) to all the points, and recompute the minimum distance; it should be the same.

Put your implementation and the code that runs your tests and prints out the results into a single file, closest.cpp, that we can compile and run. Your program should seed the random number generator in such a way that it produces different results each time it is run.

Thing 2. Try to answer the question: what is the expected minimum distance when n random points are chosen in the square [0,10]×[0,10]? Answer this question in the following way:

For each value of n=2, run your algorithm a "bunch" of times with n points, taking the average of the minimum distances that you get, where "a bunch" means enough so that the average pretty much stabilizes,

Make a CSV file with two rows containing your data: on the first row are the values of n, and on the second row are the averages that you got.

Use a spreadsheet program to graph the results.

Make the best guess you can of what function you get; experiment with different functions, seeing how well they fit the graph.

Put your best guess as a text entry on the third line of the CSV file, in the form "f(x) = ...."

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M93137952

Have any Question? 


Related Questions in Computer Engineering

Answer the following question what is the subnet mask of a

Answer the following Question : What is the subnet mask of a prefix of 26? How you obtain that subnet mask? Describe a prefix length and its used to identify networks. Descibe the ISP Tiers, classification and purposes.

The demand for salt is relatively price inelastic while the

The demand for salt is relatively price inelastic, while the demand for pretzels is relatively price elastic. How can you best explain why and elaborate your answer.

With more persons working from home how does one separate

With more persons working from home, how does one separate data intended for the employer form what might be considered personal property? What policies could be put in place to ensure employees adhere to safe guidelines ...

Uranium vi fluoride is crucial for the enrichment of

Uranium (VI) fluoride is crucial for the enrichment of weapons-grade uranium. If a 1.0 mol sample of helium effuses in 255 s, how many seconds will it take for the same amount of uranium (VI) fluoride to effuse under the ...

Are search algorithms tied to data structures being

Are search algorithms tied to data structures being searched, or can they be utilized in other scenarios?

Question what some of the reasons that evolutionary models

Question : What some of the reasons that evolutionary models are considered by many to be the best approach to software development. The response must be typed, single spaced, must be in times new roman font (size 12) an ...

Discuss the importance functionality and role of a

Discuss the importance, functionality, and role of a GateKeeper or VoIP server in a VoIP -deployed network?

Explain the differences between working in the web based

Explain the differences between working in the web based version of Outlook in Office 365 to the desktop application version of Outlook.

Question need two different postsresponses with 200 words

Question: Need two different posts(responses) with 200 words each. After reviewing the assigned reading materials, complete the following activities: 1. Develop a product service idea. A. Describe the product/service inc ...

Requirementsin this assignment you will implement a

Requirements In this assignment, you will implement a lightweight version of an ArrayList class. You may refer to the Java code and documentation for guidance, but you must write the implementation yourself. Additionally ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As