img
Question:
Published on: 25 April, 2024

a) Define big O notations.

b) \( {T(n) = 4n^{2}+3n \log_{}{n} } \), express T( n ) in Big( O ) notations.

Answer:

a) Let us two function f(n) and g(n). here g(n) is upper bounded of f(n) for some constant multiplier. So we can say that f (n) is of O(g(n)).

\( {f(n)<=c \times g(n) for all n>=n_{0}.}\)

f(n) and g(n) are function over non negative integer.

 

b) let \( { f(n) = 4n^{2}+ 3n log_{}{n} } \)

when \( {n>=1, 4n^{2}+ 3n log_{}{n} <= 4n^{2} }\)

thus \( {f(n)<=4n^{2}} \)

by definition \( {0<=f(n)<=C\times g(n)}\)

So,\( { c=4,g(n)=n^{2}}\) and \({n_{0}=1}\)

So, \( {T(n)=O(n2 )}\) for all \({n>=1 }\)

"

Random questions