


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
em nop bai thay oi, thay kiem tra giup em
Typology: Lab Reports
1 / 4
This page cannot be seen from the preview
Don't miss anything!



goal is to determine the best case, worst case and average case time required to execute a given task. Asymptotic analysis is input bound i.e., if there's no input to the algorithm, it is concluded to work in a constant time. Other than the "input" all other factors are considered constant. The Asymptotic Notations: Θ Notation: This often “theta” notation. This notation gives upper bound as well as lower bound of an algorithm. Θ (f(n)) = {g(n): there exist positive constants c1, c2 and n0 such that 0 <= c1f(n) <= g(n) <= c2f(n) for all n >= n0} f(n) gives the exact asymptotic behavior of g(n) with changing inputs i.e. g(n) is always between c1f(n) and c2f(n). If we use this notation then, o Best Case- Θ(n) o Worst case- Θ(n3) Big O Notation: This notation gives an upper bound of an algorithm, that bounds the function from above. O(f(n)) = { g(n): there exist positive constants c and n0 such that 0 <= g(n) <= cf(n) for all n >= n0} For most of the algorithms, we only have an upper bound.Thus , we use this notation. This upper bound can also be seen as tight upper bound as it is inclusive of the boundary values. Ω (Omega) Notation: This Notation will provides the lower bound of an algorithm. Thus, it is always used to provide the best case solution to a problem. Consider a function g(n) that represent run-time behavior of an algorithm where n is the number of inputs. If there exist a function f(n) such as Ω (f(n)) = {g(n): there exist positive constants c and n0 such that 0 <= cf(n) <= g(n) for all n >= n0} then f(n) is said to be lower bound for g(n). Thus f(n) gives the best case run-time for the algorithm g(n). This can also be seen as tight lower bound values as it is inclusive of lower boundary values.