I have a question about clarification of my homework.
http://www.cs.bilkent.edu.tr/~gunduz/teaching/cs201/cs201_homework3.pdf
To see the handout please go to page 25 of http://www.scribd.com/nanny24/d/36657378-Data-Structures-and-Algorithm-Analysis-in-C-Weiss.
Following is what I need to do, but I didn't understand what this means. Does it mean -for algorithm 1- compare actual running time versus (n^3 + 3*(n^2) + 2*n)/6, n=array size? I don't think so, but I couldn't infer anything else. Can you please explain me what this is?
2- Plot the expected growth rates obtained from the theoretical analysis (as given for each solution) by
using the same N values that you used in obtaining your results. Compare the expected growth rates
and the obtained results, and discuss your observations in a paragraph.
EDIT 2:
Algorithm 1:
n actual running time(ms) (n^3 + 3*(n^2) + 2*n)/6 (I don't know whether the type is millisecond or not)
100 1 171700
1000 851 167167000
So considering this huge difference between actual running time and theoretical running time, what the instructor means may be different than theoretical time complexity function which is (n^3 + 3*(n^2) + 2*n)/6 for the algorithm 1. This is the function: http://www.diigo.com/item/image/2lxmz/m7y3?size=o
Yes, your instructor means by "expected growth rate" the predicted running time after you plug in the value of n in the theoretical time complexity function.
While this usage is standard, I would still check with the instructor if I were you.
The theoretical number is probably the number of operations or comparisons or something similar.
I guess that growth rate means how fast does the value grow?. When n goes from 100 to 1000, the theoretical value grows by the factor 167167000/171700 = 973.6, compared to the real-word measured factor of 851.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With