A particular algorithm increases in time as the number of operations, n, increases.
Suppose the time complexity of this algorithm is given by: f(n) =4n3+5n2 * log(n).
Show that f(n) is O(g(n)) for g(n) = n3.
"f(x)=O(g(x))" if there exists a positive real number M and a real number x0 such that
"|f(x)|\\le Cg(x)" for all "x\\ge x_0"
So, we have:
f(n) =4n3+5n2 * log(n) < "5g(x)=5n^3" for "x\\ge 2"
where "C=5,x_0=2"
Comments
Leave a comment