[英]Determine the Big O Notation:
5n^5/2 + n^2/5 5n^5/2 + n^2/5
I tried eliminating the lower order terms and coefficients, not producing a correct answer.我尝试消除低阶项和系数,但没有产生正确的答案。
Not sure if I should use logs?不确定我是否应该使用日志?
Let f(n) = (5n^5)/2 + (n^2)/5 = (5/2)*n^5 + (1/5)*n^2
让f(n) = (5n^5)/2 + (n^2)/5 = (5/2)*n^5 + (1/5)*n^2
The Big O notation for f(n)
can be derived from the following simplification rules: f(n)
的大 O 表示法可以从以下简化规则导出:
f(n)
is a sum of several terms, we keep only the one with largest growth rate.如果f(n)
是几项的总和,我们只保留增长率最大的一项。f(n)
is a product of several factors, any constant is omitted.如果f(n)
是几个因子的乘积,则省略任何常数。 From rule 1, f(n)
is a sum of two terms, the one with largest growth rate is the one with the largest exponent as a function of n
, that is: (5/2)*n^5
根据规则 1, f(n)
是两项之和,增长率最大的一项是作为n
的函数指数最大的一项,即: (5/2)*n^5
From rule 2, (5/2)
is a constant in (5/2)*n^5
because it does not depend on n
, so it is omitted.根据规则 2, (5/2)
是(5/2)*n^5
的常数,因为它不依赖于n
,因此将其省略。
Then: f(n) is O(n^5)
那么: f(n) is O(n^5)
Hope this helps.希望这可以帮助。 Check Introduction to Algorithms检查算法简介
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.