Algorithm Analysis: Bernard Chen Spring 2006
Algorithm Analysis: Bernard Chen Spring 2006
Algorithm Analysis
Bernard Chen
Spring 2006
Why Algorithm analysis
Generally, we use a computer because
we need to process a large amount of
data. When we run a program on large
amounts of input, besides to make sure
the program is correct, we must be
certain that the program terminates
within a reasonable amount of time.
6.1 What is Algorithm Analysis?
Algorithm: A clearly specified finite set
of instructions a computer follows to
solve a problem.
Algorithm analysis: a process of
determining the amount of time,
resource, etc. required when executing
an algorithm.
Big Oh Notation
Big Oh notation is used to capture the
most dominant term in a function, and
to represent the growth rate.
Also called asymptotic upper bound.
T ( n) ( n) : linear time
T ( n) ( n log n) : famous for sorting
T ( n) ( n ) : qualratic time
2
T ( n) ( n ) : polynomial time
k