Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

can you only do? 5 and 6, please? 5) Use Excel to GRAPH the data tables from the previous functions. Use the return value as

can you only do? 5 and 6, please?

5) Use Excel to GRAPH the data tables from the previous functions. Use the return value as a function of n. That means, put n on the horizontal axis (x) and put the return value on the vertical axis (y). Use Excel or some other graphics tewl. 6) Rank the graphs above by rate of growth, fastest first.

image text in transcribedimage text in transcribed

Use empirical analysis methods and code analysis methods to determine running time complexity in Big O notation. Review of Common Math Functions. 1) Use Excel or some other graphing tool to graph the following equations. y=xy=2xy=x2y=2xy=x3y=log2x 2) Rank the graphs of the above equations by rate of growth, fastest (non-initial) growth first. 3) Match the shape of each graph with the closest common Big(O) curve and label them so. Empirical Analysis (counting the "work"). 4) Complete the table for each of the following functions. For each foo, write a small program with a loop where n is a counter from 0 to at least 64 . Call the foo within the loop, passing it each value of n, and getting the return value from foo. Fill out a table with each n and its corresponding return value. You can skip some values of n when n starts to get biggish. Capture your output and generate the tables. See the posted "Bsort Bigo.cpp" optimization code as an example of this kind of analysis. int foo1(int n ) \{ int foo3(int n) int counter =0; for (int)=n;i>0;i=1/2) counter++; return counter; // note: you might not make it much past n=32 int foo4(int n) f static int counter =0; countert+; iff(n >0) f foo4( n1) foo4( n1); ) return counter; 5) Use Excel to GRAPH the data tables from the previous functions. Use the return value as a function of n. That means, put n on the horizontal axis (x) and put the return value on the vertical axis (y). Use Excel or some other graphics tewl. 6) Rank the graphs above by rate of growth, fastest first. Code Analysis 7) Implement and test each of the following series for several different values of n and A. Present your output in a nice table of values. Use iterative solutions, do not use the equivalent (condensed) algebraic formula. I. Arithmetic Series Test for values of n from 1 to 10 . i=1Ni=1+2+3++N Iterative code solution: int sum =0; for(int i=1;i

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions