miker158
December 8th, 2006, 02:48 PM
Hi, I have just started a module in data structures and have come accross these examples which don't make much sense to me.
1st.
5n^2 + 3nlogn + 2n + 5 is O(n^2)
5n^2 + 3nlogn + 2n + 5<= (5+3+2+5)n^2 = cn^2, for c =15. when
n>=n0 (note that n log n is zero for n =1).
2nd.
20n^3 + 10nlogn + 5 is O(n^3)
20n^3 + 10nlogn + 5<=35n^3, for n>=1
Now if I am understanding the 1st example correctly to find n0 n has to be 2 due to nlogn being zero n = 1, but i dont understand why n0 is 1 for the 2nd example if nlogn is zero for n =1. If anyone can give me a hint or a suggestion it would be great.
1st.
5n^2 + 3nlogn + 2n + 5 is O(n^2)
5n^2 + 3nlogn + 2n + 5<= (5+3+2+5)n^2 = cn^2, for c =15. when
n>=n0 (note that n log n is zero for n =1).
2nd.
20n^3 + 10nlogn + 5 is O(n^3)
20n^3 + 10nlogn + 5<=35n^3, for n>=1
Now if I am understanding the 1st example correctly to find n0 n has to be 2 due to nlogn being zero n = 1, but i dont understand why n0 is 1 for the 2nd example if nlogn is zero for n =1. If anyone can give me a hint or a suggestion it would be great.