Comparing complexities


for two funtions
f(n)= n^3 if 0<=n<10,000
=n^2, otherwise
g(n)= n if 0<=n<100
=n^2+5n, otherwise
the complexity is same, how?


Because time complexity is being calculated for higher values so for f(n) we will take the time complexity which is greater than 10,000 ie n^2. Similarly for g(n) also we take otherwise part or greater than 100. It means for g(n) also the TC is n^2


okay!! i got it thanks a lot.:grinning: