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

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

View Full Document Right Arrow Icon
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(n3), O(n4), etc. However, You use O(n2) 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(n2) - Quadratic time o Example: Bubble sort O(nk) - Polynomial time O(an), 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
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/02/2012 for the course CS 251 taught by Professor Staff during the Fall '08 term at Purdue University-West Lafayette.

Page1 / 4

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

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online