Guys I have one last question on my homework.. The problems asks:
Reorder the following efficiencies from smallest to largest:
2^n
n!
n^5
10,000
nlog(n)
Again.. Please DO NOT ANSWER This directly.
My Questions:
1.) What does smallest to largest mean? Least Efficient to Most Efficient?
2.) Given that 10,000 is constant, I would assume this to be my most efficient, followed by nlog(n), followed by n!, then efficient n^5, and 2^n last. Would this be correct?
I would say probably Most Efficient to Least Efficient, so O(1) -> O(n) -> O(n2) order.
Just a hint here. Substitute several values of n for each of these and see which of them grows fastest. Make sure to use a fairly wide spread of values, like the first 7 or 8 powers of 10.