DATA STRUCTURE UNIT-1 LECTURE.NO:5 Asymptotic Notations: The asymptotic behavior of a function is the study of how the value of a function varies for larger values of “n” where “n” is the size of the input. Using asymptotic behavior we can easily find the time efficiency of an algorithm. Different asymptotic notations are: 1.Big Ο (big oh) it is the formal method of expressing the upper bound of an algorithms running time. Its a measure of longest amount of time it could possibly take for the algorithm to complete. Let f(n) is the time efficiency of an algorithm. The function f(n) is said to be Big-oh of g(n), denoted by f(n) € O(g(n)) OR f(n) ≈ O(g(n)) Such that there exist a +ve constant “c” and +ve integer n0 satisfying the constraint. f(n) ≤ c * g(n) for all n≥ n0 E.g.: Consider the following assertion: Let f(n)=100n + 5 Express f(n) using big-oh Solution: It is given that f(n) =100n + 5. Replacing 5 with n (so that next higher order term is obtained), we get 100n + n and call it c* g(n). i.e. c* g(n) = 100n + n for n = 5 = 101n for n = 5 DEPT. OF CSE/ISE NAVODAYA INSTITUTE OF TECHNOLOGY RAICHUR DATA STRUCTURE UNIT-1 LECTURE.NO:5 Now, the following constraint is satisfied f(n) ≤ c * g(n) for all n≥ n0 i.e. 100n + 5 <= 101* n for n>= 5 it is clear from the above relation that c=101, g(n)=n and n0 = 5, so by definition f(n) € O(g(n)) i.e. f(n) € O(n) 2. Ω notation (Big-Omega) Let f(n) be the time complexity of an algorithm. The function f(n) is said to be Big-Omega of g(n) which is denoted by f(n) € Ω(g(n)) OR f(n) ≈ Ω(g(n)) such that there exist a +ve constant “c” and non negative integer n0 satisfying the constraint f(n) ≥ c * g(n) for all n ≥ n0 f(n) ≥ c * g(n) for all n≥ n0 for n>= 0 i.e. 100n + 5 ≥ 100 * n it is clear from the above relation that c = 100, g(n) = n and n0 ,So by definition f(n) € Ω(g(n)) i.e. f(n) ≈ Ω(n) 3 Ex: let f(n) = 10n3 +5 10n + 5 ≥ 10 * 3 n for n ≥ 0 3 f(n) € Ω(n ) 3. Θ notation (Theta) DEPT. OF CSE/ISE NAVODAYA INSTITUTE OF TECHNOLOGY RAICHUR DATA STRUCTURE UNIT-1 LECTURE.NO:5 Let f(n) be the time complexity of an algorithm. The function f(n) is said to be Big-Theta of g(n) which is denoted by f(n) € θ(g(n)) OR f(n) ≈ θ (g(n)) such that there exist a +ve constant“c1, c2” and non negative integer n0 satisfying the constraint c2g(n) ≤ f(n) ≥ c1g(n) for all n ≥ n0 Ex: Let f(n) = 100n + 5 express f(n) using big-theta c2g(n) ≤ f(n) ≥ c1g(n) for all n ≥ n0 100 * n ≤ 100n + 5 ≥ 100n+n for n ≥ 5 It is clear from the above relation that c1=100, c2=105, n0= 5, g(n)= n So by definition f(n) € θ(g(n)) f(n) € θ(n) DEPT. OF CSE/ISE NAVODAYA INSTITUTE OF TECHNOLOGY RAICHUR
© Copyright 2026 Paperzz