Problem 6. Professor I. M. Nuts of the Math Department is scratching his head over the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Problem 6. Professor I. M. Nuts of the Math Department is scratching his head over the following problem. Given two sequences of numbers X (x1,...,xn) and Y = (y₁,..., yn) he must find the m≤ √n largest values of the sums xi + Yj, 1 ≤ i, j≤n in SORTED ORDER (smallest to largest). One may assume that m≤ √√n but one must not assume that m is a constant. The proposed algorithm should have worst-case running time that is o(n²). He requests the assistance of the CS Department in dealing with this problem. (a) Give an algorithm whose worst-case running time is o(n²) that solves this problem; an (n²2) time algorithm will not get you any points. (b) Does there exist an algorithm whose worst-case performance is O(n) ? Explain, i.e. show/prove that such an algorithm does not exist or give the algorithm and analyze its performance, if such an algorithm exists. Example. If X = (2,0, -2, -3, 1, 100, 290, 300, 4) and Y (-20, -19,-8, -200, 11, 1, 10, -7,0) and m = 3 then the answer is (301, 310, 311). Note that 301 can result either as the sum of 290 + 11 or 300 + 1. = - Problem 6. Professor I. M. Nuts of the Math Department is scratching his head over the following problem. Given two sequences of numbers X (x1,...,xn) and Y = (y₁,..., yn) he must find the m≤ √n largest values of the sums xi + Yj, 1 ≤ i, j≤n in SORTED ORDER (smallest to largest). One may assume that m≤ √√n but one must not assume that m is a constant. The proposed algorithm should have worst-case running time that is o(n²). He requests the assistance of the CS Department in dealing with this problem. (a) Give an algorithm whose worst-case running time is o(n²) that solves this problem; an (n²2) time algorithm will not get you any points. (b) Does there exist an algorithm whose worst-case performance is O(n) ? Explain, i.e. show/prove that such an algorithm does not exist or give the algorithm and analyze its performance, if such an algorithm exists. Example. If X = (2,0, -2, -3, 1, 100, 290, 300, 4) and Y (-20, -19,-8, -200, 11, 1, 10, -7,0) and m = 3 then the answer is (301, 310, 311). Note that 301 can result either as the sum of 290 + 11 or 300 + 1. = -
Expert Answer:
Answer rating: 100% (QA)
a Algorithm 1 Initialize a twodimensional array Anm where n is the size of both X and Y and m is the ... View the full answer
Related Book For
Posted Date:
Students also viewed these databases questions
-
A chemist is calibrating a spectrophotometer that will be used to measure the concentration of carbon monoxide (CO) in atmospheric samples. To check the calibration, samples of known concentration...
-
The accounts that will be used by Zant Moving Company follow. Prepare a chart of accounts for the firm. Classify the accounts by type, arrange them in an appropriate order, and assign suitable...
-
The accounts that will be used by Dad & Sons Moving Company follow. Prepare a chart of accounts for the firm. Classify the accounts by type, arrange them in an appropriate order, and assign suitable...
-
EVE, Inc. reported a return on investment of 20%, a sales margin of 25%, and residual income of $480,000. The required rate of return on invested capital is 8%. On the basis of this information, the...
-
Circle whether each of the following events/transactions will (I)ncrease, (D)ecrease, or have (No) effect on stockholders equity. STOCKHOLDERS EQUITY (Circle the answer) a. Issue preferred stock at...
-
Determine the force in each member of the truss and state whether it is in tension or compression. 2k A D 6 ft B 8 ft Prob. F3-4
-
Use the exponent distributive rule to expand \((6 \times 13)^{7}\).
-
Jim Andrews opened a delivery business in March. He rented a small office and has a part-time assistant. His trial balance shows accounts for the first three months of business. Andrews' transactions...
-
Seattle Health Plans currently uses zero-debt financing. Itsoperating income (earnings before interest and taxes, or EBIT) is$1 million, and it pays taxes at a 40 percent rate. It has $5million in 2...
-
Financial statement data of ABC Fencing, Inc. include the following items: Cash .................... $ 21,000 Short-Term Investments .......... 25,000 Accounts Receivable, Net .......... 102,000...
-
A simplified quarter-car suspension system is illustrated in Figure 1. The road position r and the car position z are indicated. Assume their initial positions (in a static equilibrium position) are...
-
Find the determinant of 2 A= 00 0-10 0 7 43 5 6 22 4
-
. What is one direct way in which children impact their own acculturation? How does the example you chose show the child's impact? . What is one indirect way in which children impact their own...
-
Tetracycline hydrochloride (Achromycin V, Lederle) is prescribed for a young adult male patient (28 years old, 78 kg) suffering from gonorrhea. According to the literature, tetracycline HCI is 77%...
-
Solve the inequality. State the solution set in interval notation and graph it. 2x+3
-
Futura Company purchases the 67,000 starters that it installs in its standard line of farm tractors from a supplier for the price of $11.30 per unit. Due to a reduction in output, the company now has...
-
Using Java: Add the Queue class to the second program introduced in this lesson. The class must provide for a. Create the queue b. Insert at one end c. Make extractions from the other end d....
-
One Way Cellular accountants have assembled the following data for the year ended September 30, 2014: Prepare the operating activities section using the indirect method for One Way Cellulars...
-
Refer to Exercise 2 in Section 8.2. a. Using each of the three models in turn, predict the NOx emission when Speed = 1500, Torque = 400, and HP = 150. b. Using each of the three models in turn,...
-
The article "Effect of Granular Subbase Thickness on Airfield Pavement Structural Response" (K. Gopalakrishnan and M. Thompson, Journal of Materials in Civil Engineering, 2008:331-342) presents a...
-
A statistics instructor who teaches a lecture section of 160 students wants to determine whether students have more difficulty with one-tailed hypothesis tests or with two-tailed hypothesis tests. On...
-
Find the greatest common divisor of 1,400 and 250 by listing all divisors of each number.
-
Find the greatest common divisor of 600 and 784 by using their prime factorizations.
-
Find the greatest common divisor of 1,400 and 250 by using their prime factorizations.
Study smarter with the SolutionInn App