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...
-
A U.S. pension fund has a domestic portfolio with an expected return of 10 percent and a standard deviation of 12 percent. It also invests in a foreign equity fund that has an expected dollar return...
-
The following trial balance was extracted from the books of F. Sorley on 30 April 2017. From it, and the note about inventory, prepare his statement of profit or loss for the year ending 30 April...
-
Determine if the mixed method aspect is concurrent, sequential,, or nested. Develop a hypothetical research scenario that would necessitate the use of the Mixed Method A-B-A Design. The research will...
-
Given the data and information that follow, compute the total direct cost for each project duration. If the indirect costs for each project duration are $90 (15 time units), $70 (14), $50 (13), $40...
-
A violet ray of light leaves a medium with refractive index of 6.46 at an angle of 0.07 radians to the normal and enters a second medium with refractive index of 22.04. At what angle to the normal...
-
Lakey International is a foreign corporation that maintains its books of record in foreign currency (FC), although its functional currency is the U.S. dollar. Lakey originally began operations on...
-
Assume that Zhang Corporation will need to sell 200,000 British pounds in 90 days. A call option exists on British pounds with an exercise price of $1.68, a 90-day expiration date, and a premium of...
-
The case study explores design/manufacturing flaws, often involving errors or faulty assumptions during the design or manufacturing process. USAir Airlines Flight 427. Boeing Model 737-3B7. Give a...
-
Yuki expects a completion bonus of $184000 in three years, at the end of a long-term consulting contract. Her interest rate forecast is 6.6% in year 1, 6% in year 2, and 5% in year 3. What is the...
-
The Porter Company produces messenger bags. Porter must decide how many bags to produce each month? The company will use a 6-month planning horizon. The forecasted monthly demands for the next six...
-
A cash basis taxpayer sold investment land in 2022. He received $200,000 in the year of sale and $600,000 in 2023. The cost of the land was $400,000. The taxpayer uses the installment method. What is...
-
Given the following information, determine the cost of goods sold for the period. Date Jan 1 Beginning Inventory $950 Jan 1-30 Purchases $1800 Jan 31 Ending Inventory $250.
-
25. Explain one important take away that you will use in your future about the 2008 financial crisis.
-
The May 2014 revenue and cost information for Houston Outfitters, Inc. follow: Sales Revenue (at standard).............. $ 540,000 Cost of Goods Sold (at standard) ..........341,000 Direct Materials...
-
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...
-
The pirate industry has taken hold in Somalia, and with 23,000 ships coming through the Gulf of Aden annually, the operations of pirates appear to be located centrally. There are 18 to 21 ships...
-
NLC issued a report that Liz Claiborne, Walmart, Ann Taylor, Esprit, Ralph Lauren, JCPenney, and Kmart were using subcontractors in China that use Chinese women (between the ages of 17 and 25) to...
-
In the early 1980 s, Colombian drug barons, large landowners, industrialists, and bankers, with the cooperation of the Colombian government, began to create private paramilitary units to combat the...
Study smarter with the SolutionInn App