1. Algorithms X and Y take exactly T.(n) = cinlogn and Ty(n) = cn microseconds, respectively,...
Fantastic news! We've Found the answer you've been seeking!
Transcribed Image Text:
1. Algorithms X and Y take exactly T.(n) = cinlogn and Ty(n) = c₂n³ microseconds, respectively, for a problem of size n. Find the best algorithm for processing n = 220 data items if the algorithm X takes 10 microseconds to process 1024 items and the algorithm Y takes only 1 microsecond to process 1024 items? 2. If f(n) = n²/log n and g(n) = n(log n)², Explain (using algebraic expression) whether f(n) is in O(g(n)), 2(g(n), or 0(g(n)) ? 3. For the given code segment sum = 0; for(i=0;i<sqrt(n)/2;i++) sum++; for(j=0;j<sqrt(n)/4;j++) sum++; for(k 0;k<8+j;k++) sum++; (a) If it takes 0.5 ms for input size 100. How long will it take for input size 500 with respect to its running time (Big-Oh notation)? 4. Give an analysis of the running time (Big-Oh notation) for the following program fragments. Note that the running time corresponds here to the number of times each step is executed? (a) for(i=1;i<2*n;i++) for(j=1:j<i*i;j++) for(k=1;k<j;k++) if (j %i) sum++; (b) int count = 0; for (int i=n/2; i<n; i++) } for (int j=1; j<n; j = 2 *j) (c) int i=1, s=1; while (s <= n) { (d) i=n; for (int k=1; k<n; k = k * 2) count++; i++; s += i; while(i > 1) { while (j<n) { } i=i/2; k = 0; while (k <n) { } j<--j*2; k=k+ 2; } (e) Order the computed time complexities (a - d) by growth rate from slowest to fastest 1. Algorithms X and Y take exactly T.(n) = cinlogn and Ty(n) = c₂n³ microseconds, respectively, for a problem of size n. Find the best algorithm for processing n = 220 data items if the algorithm X takes 10 microseconds to process 1024 items and the algorithm Y takes only 1 microsecond to process 1024 items? 2. If f(n) = n²/log n and g(n) = n(log n)², Explain (using algebraic expression) whether f(n) is in O(g(n)), 2(g(n), or 0(g(n)) ? 3. For the given code segment sum = 0; for(i=0;i<sqrt(n)/2;i++) sum++; for(j=0;j<sqrt(n)/4;j++) sum++; for(k 0;k<8+j;k++) sum++; (a) If it takes 0.5 ms for input size 100. How long will it take for input size 500 with respect to its running time (Big-Oh notation)? 4. Give an analysis of the running time (Big-Oh notation) for the following program fragments. Note that the running time corresponds here to the number of times each step is executed? (a) for(i=1;i<2*n;i++) for(j=1:j<i*i;j++) for(k=1;k<j;k++) if (j %i) sum++; (b) int count = 0; for (int i=n/2; i<n; i++) } for (int j=1; j<n; j = 2 *j) (c) int i=1, s=1; while (s <= n) { (d) i=n; for (int k=1; k<n; k = k * 2) count++; i++; s += i; while(i > 1) { while (j<n) { } i=i/2; k = 0; while (k <n) { } j<--j*2; k=k+ 2; } (e) Order the computed time complexities (a - d) by growth rate from slowest to fastest
Expert Answer:
Answer rating: 100% (QA)
1 It is given that Tx C n log n microseconds We hav... View the full answer
Related Book For
Modeling the Dynamics of Life Calculus and Probability for Life Scientists
ISBN: 978-0840064189
3rd edition
Authors: Frederick R. Adler
Posted Date:
Students also viewed these general management questions
-
X and Y take the value 0 with probability 0.5 and the value 1 with probability 0.5. Consider independent random variables X and Y with identical probability distributions as given. Let Z = X + X and...
-
X and Y take the value 0 with probability 0.25, the value 1 with probability 0.5, and the value 2 with probability 0.25. Consider independent random variables X and Y with identical probability...
-
When does the cost of goods sold move from the balance sheet to the income statement? A) When goods are put into production. B) While in finished goods inventory. C) After the products are finished....
-
Outback Steakhouse grew explosively during its first years of operation. The numbers of Outback Steakhouse locations for the period 1988-1993 are given below. a. Does there appear to be linear or...
-
Apply the ERR method with ϵ = 12% per year to the following series of cash flows. Is there a single, unique IRR for these cash flows? What is the maximum number of IRRs suggested by...
-
For the determination of the activity coefficient for the system comprising relatively simple and preferably non-polar liquids, we generally use the (a) Wohl's equation (b) Margules equation (c) Van...
-
Listed here are live scenarios. For each scenario, discuss the possible damages that can occur. Suggest a preventive control. a. An intruder taps into a telecommunications device and retrieves the...
-
When delivering a professional development, feedback from your audience is important for continuous improvement. Other than a satisfaction survey, provide 2-3 other methods that can be used to...
-
A company wants to build a website where user can register themselves and buy/renew health insurance policies. Also, they can process claims from a separate section on the website. Once logged in,...
-
The table below shows hypothetical values of the expenditure components for the United States in 2016. Expenditures in the United States Durable goods Nondurable goods Services Gross investment...
-
Provide an analysis of the google self driving program using the following 7 articles. Address the questions below in your response. Please be very detailed. Include stakeholder management and risk...
-
se the information provided below to prepare the Statement of Comprehensive Income of Cheshire Ltd for the year ended 3 1 December 2 0 2 3 . INFORMATION The information given below was extracted from...
-
Problem 2: In problem 1, the monopolist sells a product with a total cost function: TC= 1,000+500Q+Q. The market demand curve is given by the equation: Q-500-0.25P But now assume that the government...
-
Review and critique the literature and conceptual models that researchers have developed to explain how to create a climate for innovation that would enable and motivate project managers, project...
-
The YIA Partnership decided to liquidate as of December 31, 2021. Its balance sheet as of this date as follows: 2. Cash Account Receivable (Net) Inventory Property, Plant, and Equipment (Net) Patent...
-
The following information was gathered for the Belvedere Corporation for the most recent year. Manufacturing overhead is allocated using direct labor hours. Estimated direct labor hours 56,000 Actual...
-
Why did management adopt the new plan even though it provides a smaller expected number of exposures than the original plan recommended by the original linear programming model?
-
Student 2 comes to class with probability 8/9 if student 1 does. Student 3 ignores them. A small class has only three students. Each comes to class with probability 0.9. Find the probability that all...
-
Use Newton's method for three steps to solve the following equations. Find and sketch the tangent line for the first step, then find the Newton's method discrete-time dynamical system to check your...
-
Redo the test using . How different are the results? Under what circumstances might it make a larger difference which proportion was used? Algorithm 8.4 uses 1 and 2 to estimate the variance under...
-
Calculate the correlations among all numeric variables in Exercise 9.1 using SPSS, or R. (In R read in the data as a data.frame (e.g., theData) and then use (cor(theData). You dont need to attach...
-
Using one of the online calculators, how large a correlation would you need for the relationships shown in Exercise 9.2 to be significant? (This will involve a bit of trial and error.) Calculate the...
-
What are the strongest single predictors of infant mortality in Exercise 9.2? Exercise 9.2 Calculate the correlations among all numeric variables in Exercise 9.1 using SPSS, or R. (In R read in the...
Study smarter with the SolutionInn App