I need to derive the Big-O complexity of this expression:
c^n + n*(log(n))^2 + (10*n)^c
where c is a constant and n is a variable.
I'm pretty sure I understand how to derive the Big-O complexity of each term individually, I just don't know how the Big-O complexity changes when the terms are combined like this.
Ideas?
Any help would be great, thanks.
The answer depends on |c|
If |c| <= 1 it's O(n*(log(n))^2)
IF |c| > 1 it's O(c^n)
The O() notation considers the highest term; think about which one will dominate for very, very large values of n
.
In your case, the highest term is c^n
, actually; the others are essentially polynomial. So, it's exponential complexity.
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