2. Big oh(o) notation
- is a mathematical notation that describes the limiting
behavior of a function when the argument tends towards a
particular value or infinity.
We may write--> f(n)=O(g(n))
“f(n) is of order g(n)”
Ex-
Linear search—O(n)
Binary search—O(log n)
Bubble sort—O(n² )
1
3. Omega notation(Ω)
-is used when the function g(n) defines a lower bound
for the function f(n).
We may write--> f(n)= Ω(g(n))
“f(n) is omega of g(n)”
Ex- for, f(n)=90n² +18n+6
Here, f(n)= Ω(n² )
2
4. Theta notation(Θ)
-is used when the function f(n) is bounded both from
above and below by the function g(n).
We may write--> f(n)= Θ(g(n))
“f(n) is theta of g(n)”
Ex-for, f(n)=18n+9
Here, f(n)= Θ(n)
3
Editor's Notes
In computer science, big O notation is used to classify algorithms according to how their running time or space requirements grow as the input size grows.