# Lecture 8 - January 31, 2011

On Monday January 31st, 2011 we only covered chapter 2 homework. I'd like to note that I'm experiencing difficulty uploading the pictures to the wiki if anyone else is not experiencing any issues then please tell me and i can shoot the images over to you for upload. Thanks. I currently have pictures of the homework and of Appendix A.

## Chapter 2 Summary

Chapter 2 focuses on the Fundamentals of the Analysis of Algorithms Efficiency. The American Heritage Dictionary defines "analysis" as "the separation of an intellectual or substantial whole into its constituent parts for individual study". The term "analysis of algorithms" is usually used in a narrower technical sense to mean an investigation of an algorithm's effiency with respect to two resources: running time and memory space.

### Analysis Frameworks & Algorithms key points

- Both time and space efficiencies are measured as functions of the algorithm's input size.

- Time efficiency is measured by counting the number of times the algorithm's basic operation is executed.Space efficiency is measured by counting the number of extra memory units consumed by the algorithm.
- The efficiencies of some algorithms may differ significantly for inputs of the same size. For such algorithms, we need to distinguish between the worst-case, average-case, and best-case efficiencies.
- The framework's primary interest lies in the order of growth of the algorithm's running time (extra memory units consumed) as its input size goes to infinity.
- The notations "big-O, big-Omega, big-theta" are used to indicate and compare the asymptotic orders of growth of functions expressing algorithm efficiencies.
- The efficiencies of a large number of algorithms fall into the following few classes: constant, logarithmic, linear, n log n, quadratic, cubic, and exponential.
- The main tool for analyzing the time efficiency of a non recursive algorithm is to set up a sum expressing the number of executions of its basic operation and ascertain the sum's order of growth.
- The main tool for analyzing the time efficiency of a recursive algorithm is to set up a recurrence relation expressing the number of executions of its basic operation and ascertain the solution's order of growth.
- Succinctness of a recursive algorithm may mask its inefficiency.
- The fibonacci numbers are an important sequence of integers in which every element is equal to the sum of its two immediate predecessors. There are several algorithms for computing the Fibonacci numbers with drastically different efficiencies.
- Empirical analysis of an algorithm is performed by running a program implementing the algorithm on a sample of inputs and analyzing the data observed (the basic operation's count or physical running time). This often involves generating pseudorandom numbers. The applicability to any algorithm is the principle strength of this approach; the dependence of results on the particular computer and instance sample is its main weakness.
- Algorithm visualization is the use of images to convey useful information about algorithms. the two principle variations of algorithm visualization are static algorithm visualization and dynamic algorithm visualization.