# Ch14 - Chapter 14 Time Complexity Time Complexity s s s The...

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

Chapter 14 Time Complexity

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

View Full Document
2 Time Complexity The study of complexity of a problem is the study of the complexity of the algorithm that solves the problem. The computational complexity of an algorithm is measured by the amount of resources required to carry it out, i.e., time and space . The time complexity of a computation C is determined by the amount of time required to perform C , whereas the space complexity of C is determined by the amount of storage space required by C .
3 14.2 Rates of Growth The rate of growth of a function, which measures the increase of the function values as the input gets arbitrarily large , is determined by the most significant contributor to the growth of the function. Table 14.2 ( Growth of functions ) the linear and constant terms of n 2 + 2 n + 5 are called the lower-order terms , which do not significantly contribute to the growth of the function values. n 0 5 10 25 50 100 1,000 20 n + 500 500 600 700 1,000 1,500 2,500 20,500 n 2 0 25 100 625 2,500 10,000 1,000,000 n 2 + 2 n + 5 5 40 125 680 2,605 10,205 1,002,005 n 2 /( n 2 + 2 n + 5) 0 0.625 0.800 0.919 0.960 0.980 0.998

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

View Full Document
4 14.2 Rates of Growth Defn 14.2.1 Let f : N N and g : N N be one-variable number-theoretic functions. i. f is said to be of order g , written f O ( g ), if there is a positive constant c and natural number n 0 such that f ( n ) c × g ( n ), 2200 n n 0 i. O ( g ) = { f | f is of order g }, i.e., the set of all functions of order g , is called the “big oh of g f is of order g , written f O ( g ), if the growth of f is bounded by a constant multiple of the values of g
5 14.2 Rates of Growth The rate of growth is determined by the most significant contributor to the growth of the function. If f O ( g ) and g O ( f ), then given two positive constants C 1 and C 2 , f ( n ) C 1 × g ( n ), 2200 n n 1 ; g ( n ) C 2 × f ( n ), 2200 n n 2 f and g have the same rate of growth, i.e ., neither f nor g grow faster than the other.

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

View Full Document
6 14.2 Rates of Growth A function f is said to exponentially
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 03/02/2012 for the course C S 252 taught by Professor Dennisng during the Winter '12 term at BYU.

### Page1 / 16

Ch14 - Chapter 14 Time Complexity Time Complexity s s s The...

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

View Full Document
Ask a homework question - tutors are online