Question

The algorithm for the Closest Point Pair problem (that we discussed in class) is careful to...

The algorithm for the Closest Point Pair problem (that we discussed in class) is careful to ensure that it does O(n) work outside of the recursive calls. In this problem, I want to investigate the consequences of not being this careful, on the running time of algorithm for his problem. Specifically, suppose that instead of sorting the points initially (outside the recursion), we sort the points as needed (by x-coordinate and by y-coordinate) inside the recursive calls.

(a) Write down the recurrence relation that characterizes the running time of this new algorithm. (b) Solve this recurrence to obtain the running time of this new algorithm.

0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
The algorithm for the Closest Point Pair problem (that we discussed in class) is careful to...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • 2. In class, we discussed the recursive Merge-Sort algorithm. This sorts the whole array by sorting...

    2. In class, we discussed the recursive Merge-Sort algorithm. This sorts the whole array by sorting the left side, sorting the right side, and then merging them. Write a similar recursive algorithm that finds the maximum element of an array. (Find the max of the left side, then find the maximum of the right side, then compare the two.) Write pseudo-code for this algorithm. Give the recurrence relation that describes the number of comparisons that your algorithm uses.

  • Question #4 (15 points) In class, we discussed a divide-and-conquer algorithm for matrix multiplication that involved...

    Question #4 (15 points) In class, we discussed a divide-and-conquer algorithm for matrix multiplication that involved solving eight subproblems, each half the size of the original, and performing a constant number of e(n) addition operations. Strassen's Algo- rithm, which we did not cover, reduces the number of (half-sized) subproblems to seven, with a constant number of e(n) addition and subtraction operations. Provide clear, concise answers to each of the following related questions. • (7 points). Express the runtime of Strassen's...

  • 4 Problem 4 -Extra Credit Given an array A, we say that elements A and Al...

    4 Problem 4 -Extra Credit Given an array A, we say that elements A and Al are swapped if J >「 but Alj]< A[i]. For example, if A - [8,5,9,7], then there are a total of3 swapped pairs, namely 8 and 5; 8 and 7; and 9 and 7 Describe a recursive algorithm that given an array A, determines the number of swapped pairs in the array in O(n log(n)) time. To analyze the algorithm, you must state the recurrence...

  • I already solved part A and I just need help with part B 1. Matrix Multiplication...

    I already solved part A and I just need help with part B 1. Matrix Multiplication The product of two n xn matrices X and Y is a third n x n matrix 2 = XY, with entries 2 - 21; = xixYk x k=1 There are n’ entries to compute, each one at a cost of O(n). The formula implies an algorithm with O(nº) running time. For a long time this was widely believed to be the best running...

  • Problem 2: As we discussed in class, one can use an algorithm for computing all-pairs shortest...

    Problem 2: As we discussed in class, one can use an algorithm for computing all-pairs shortest paths to also compute the transitive closure of a graph. If using Floyd-Warshall for example, it is possible to do this in On") time (where as usual n is the number of nodes and m is the number of edges). Show how to compute the transitive closure of a directed graph in O(nm) time. For which type of graphs is this better than using...

  • Java We did in lecture, and explain your answer briefly. Problem 4: Sorting practice 14 points;...

    Java We did in lecture, and explain your answer briefly. Problem 4: Sorting practice 14 points; 2 points for each part individual-only Important: When answering these questions, make sure to apply the versions of these algorithms that were discussed in lecture. The Java code for each algorithm can be found in our Sort class. Given the following array: {14, 7, 27, 13, 24, 20, 10, 33 1. If the array were sorted using selection sort, what would the array look...

  • Decrease-by-Half Algorithm We can solve the same problem using a decrease-by-half algorithm. This...

    Convert the pseudocode into a C++ function Decrease-by-Half Algorithm We can solve the same problem using a decrease-by-half algorithm. This algorithm is based on the following ideas: In the base case, n 1 and the only possible solution is b 0, e 1 In the general case, divide V into a left and rnight half; then the maximum subarray can be in one of three places: o entirely in the left half; o entirely in the right half; or o...

  • In class we wrote a method closestPairFast that on an input array of numbers, finds the...

    In class we wrote a method closestPairFast that on an input array of numbers, finds the distance of the closest pair by first sorting the input array and then finding the closest adjacent pair. (See the file ClosestPair1D.java in the Code folder on D2L.) In this problem, you are asked to modify the method so that it returns an integer array consisting of the indices of the closest pair in the original array. If there is a tie, just return...

  • I posted the question for this and I want to make sure that this answers the...

    I posted the question for this and I want to make sure that this answers the question 1.a) The pseudo code for the closest pair problem is as illustrated below: Closest pair (K, i, j) input: Array K is indexed from i to j. closest pair returns the indices of the closest pairs. diff = K[2] - K[1]   // This is the initial difference between the first two numbers. This is shown through the array and these differences. example: K[2]...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT