Algorithm Efficiency
algorithm, performance
Solution
You define `n` to be `1000`. Thus, you need n3 steps, each one of them taking `1 ns`. Multiply the two and you have the answer.
General idea: if an algorithm needs `f(n)` number of steps and one step takes `t` then you need `t * f(n)` for the algorithm.
Problem
So this is a question in my homework.... Given that the efficiency of an algorithm is n3, if a step in the algorithm takes 1 ns (10-9) seconds), how long does it take the algorithm to process an input of size 1,000? Here is MY question: How do I figure this out? PLEASE DO NOT POST THE ANSWER. Help me learn how to figure this out for myself.