Sep 10, 2024
N
N
Big O Notation
f(x) is in Big O of g(x)
if there exist constants C
and xā
such that f(x) <= C * g(x)
for all x > xā
Big Omega Notation
f(x) is in Big Omega of g(x)
if there exist constants C
and xā
such that f(x) >= C * g(x)
for all x > xā
Big Theta Notation
f(x) is in Big Theta of g(x)
if there exist constants C1
, C2
, and xā
such that C1 * g(x) >= f(x) >= C2 * g(x)
for all x > xā
n
f(n) is in Big O of g(n)
if there exists C
and nā
such that f(n) <= C * g(n)
for all n >= nā
f(n) is in Big Omega of g(n)
if there exists C
and nā
such that f(n) >= C * g(n)
for all n >= nā
f(n) is in Big Theta of g(n)
if there exist C1
, C2
, and nā
such that C1 * g(n) >= f(n) >= C2 * g(n)
for all n >= nā