Menu

[Solved]Given N X1 X2 Xn D1 D2 Dn D Graph Given Constructed Time Takes Construct Graph Part Over Q37049080

2. Suppose you and your friend live on the same street D miles away from each other. Between your house and your friends hou

We are given n,x1,x2,…,xn,d1,d2,…,dn,D. The graph isnot given and it should be constructed. The time it takes toconstruct a graph is part of the overall time complexity, so itshould be included.

The solution is your algorithm, which includes the graphconstruction. It is fine if the algorithm consists of severalparts, which perform different tasks. The algorithm should returnthe actual path.The proof and run-time analysis should be providedfor the entire solution/algorithm.

Please show your wrok. Tyvm!

2. Suppose you and your friend live on the same street D miles away from each other. Between your house and your friend’s house there are n motorized scooters positioned at distances x1,22,…,-n miles from your house towards your friend’s house. Each scooter has a battery that may or may not be fully charged. Let’s say that the scooters can take you distances di, d2,…. dn miles down the road and you have access to all of this information before you go. Any time you encounter another scooter, you may take the new scooter and leave your old scooter behind There is an additional scooter at your house that you start with and it can go distance do miles. You wish to go to your friend’s house minimizing the number of times you change scooters. Your House Your Friend’s 田 田 X4 X5 5 points Describe a graph whose paths represent sequences of scooters you could use 10 points Design an algorithm that solves this problem efficiently using this graph. (6 points for correct algorithm and correctness proof and 4 points for time analysis.) Show transcribed image text 2. Suppose you and your friend live on the same street D miles away from each other. Between your house and your friend’s house there are n motorized scooters positioned at distances x1,22,…,-n miles from your house towards your friend’s house. Each scooter has a battery that may or may not be fully charged. Let’s say that the scooters can take you distances di, d2,…. dn miles down the road and you have access to all of this information before you go. Any time you encounter another scooter, you may take the new scooter and leave your old scooter behind There is an additional scooter at your house that you start with and it can go distance do miles. You wish to go to your friend’s house minimizing the number of times you change scooters. Your House Your Friend’s 田 田 X4 X5 5 points Describe a graph whose paths represent sequences of scooters you could use 10 points Design an algorithm that solves this problem efficiently using this graph. (6 points for correct algorithm and correctness proof and 4 points for time analysis.)

Expert Answer


Answer to We are given n,x1,x2,…,xn,d1,d2,…,dn,D. The graph is not given and it should be constructed. The time it takes to co… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *