An algorithm is analyzed and found to take time as a functio
Solution
Answer:
T(n) = 2n^2 + 5n
Now , as we can see the highest power in the function is n^2 . Therefore its order is n^2 = O(n^2)
b) Now we know the big O definition :
f(n) = 2n^2 + 5n
f(n) < = c0 * g(n)
2n^2 + 5n < = c0 * n^2
let c0 = 1
2n^2 + 5n = n^2
=> 2n^2 + 5n -n^2 = 0
=> n^2 + 5n = 0
=> n( n + 5) = 0
=> n = 5
Therefore c0 = 1 , n0 = 5.
