








Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!









Efficiency (Complexity)
Time Efficiency Improvements
Possibilities (some better than others!)
Moral - Choose the most appropriate algorithm(s) BEFORE program implementation
Asymptotic Analysis (Runtime Analysis)
T(n) = O(f(n))
Said: T of n is āon the order of f(n)
Common Functions in Big-Oh (Most Efficient to Least Efficient)
Constant growth. The runtime does not grow at all as a function of n. It is a constant. Basically, it is any operation that does not depend on the value of n to do its job. Has the slowest growth pattern (none!).
Examples:
Common Functions in Big-Oh (conāt)
Logarithmic growth. The runtime growth is proportional to the base 2 logarithm (lg) of n.
Example:
Common Functions in Big-Oh (conāt)
n log n growth. Any sorting algorithm that uses comparisons between elements is O(n lg n).
Examples
Common Functions in Big-Oh (conāt)
Polynomial growth. Runtime grows very rapidly.
Examples:
So, Which Algorithm Do I Choose?
So, Which Algorithm Do I Choose? (conāt)