{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

notes70

# notes70 - Asymptotic Notation Goal To simplify analysis by...

This preview shows pages 1–2. Sign up to view the full content.

Asymptotic Notation Goal: To simplify analysis by getting rid of unneeded infromation. It tels us how an algorithm "scales up", that is, how it behaves with large inputs. Example: Execution time of an algorithm = 0.000001n 2 + 10n + 1000 = O(n 2 ) It is also O(n 3 ), O(n 4 ), etc. However, You use O(n 2 ) because it better describes how the execution time grows with n. Special classes of algorithms O(1) - Constant time o Example: adding, accessing memory, array indexing O(n) - Linear Time o Example: Traverse list O(log n) - Logarithmic time o Example: Traversing balanced tree O(n log n) - n log n o Example: Sorting O(n 2 ) - Quadratic time o Example: Bubble sort O(n k ) - Polynomial time O(a n ), n > 1 - Exponential time o Example: np complete problem, travelling salesman problem, optimal solution for chess game, stock market analysis, etc. O(?) o Example: Problem with no solution, making a program that will correct any input. Example: Obtain time compexity (asymptotic time) of obtaining the maximum of an array of numbers:

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}