










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
this doc use for it students so every study well
Typology: Study notes
1 / 18
This page cannot be seen from the preview
Don't miss anything!











Level: 5 Credit Value: 20
Lecturer: Ms. Sathananthy 1 05/21/
Learning Outcome 03
2 05/21/
Asymptotic Notation A problem may have numerous algorithmic solutions. In order to choose the best algorithm for a particular task, you need to be able to judge how long a particular solution will take to run. Need a way to compare algorithms with one another. Asymptotic Complexity is a way of expressing the main component of the cost of an algorithm, using idealized units of computational work.
Asymptotic Analysis – contd. 5 05/21/ In mathematical analysis, asymptotic analysis of algorithm is a method of defining the mathematical bound of its run-time performance. Using the asymptotic analysis, we can easily conclude about the average case, best case and worst case scenario of an algorithm. It is used to mathematically calculate the running time of any operation inside an algorithm. Example: Running time of one operation is x(n) and for another operation it is calculated as f(n^2 ). It refers to running time will increase linearly with increase in 'n' for first operation and running time will increase exponentially for second operation. Similarly the running time of both operations will be same if n is significantly small.
Asymptotic Analysis – contd. 7 Usually the time required by an algorithm comes under three types: Worst case: It defines the input for which the algorithm takes the huge time. Average case: It takes average time for the program execution. Best case: It defines the input for which the algorithm takes the lowest time. 05/21/
Asymptotic Notations 8
05/21/
10
Big O Notation Binary search Proportional to log(N) T ∝log2(N) T= k* log2(N) T=k*log(N) 11
13 05/21/
Theta Notation (θ) 14 05/21/ It is the formal way to express both the upper bound and lower bound of an algorithm running time. Consider the running time of an algorithm is θ (n) , if at once (n) gets large enough the running time is at most k2-n and at least k1? n for some constants k1 and k2. It is represented as shown below:
Exercises 16 05/21/
Exercises 17 05/21/ Assume that each of the expressions gives the processing time T(n) spent by an algorithm for solving a problem of size n. Select the dominant term(s) having the steepest increase in n and specify the lowest Big-Oh complexity of