# Cs202 lecture notes Asymptotic Analysis A programmer usually has a choice of data structures and algorithms to use. Choosing the best one for a particular job involves, among other factors, two important measures: A programmer will sometimes seek a tradeoff between space and time complexity.

For example, a programmer might choose a data structure that requires a lot of storage in order to reduce the computation time. There is an element of art in making such tradeoffs, but the programmer must make the choice from an informed point of view. The programmer must have some verifiable basis on which to make the selection of a data structure or algorithm.

Complexity analysis provides such a basis. Complexity Complexity refers to the rate at which the storage or time grows as a function of the problem size. The absolute growth depends on the machine used to execute the Cs202 lecture notes, the compiler used to construct the program, and many other factors.

This means that we must not try to describe the absolute time or storage needed. We must instead concentrate on a "proportionality" approach, expressing the complexity in terms of its relationship to some known function. This type of analysis is known as asymptotic analysis.

## Building a "Wrapper Class" for Nicer Pointers

Asymptotic Analysis Asymptotic analysis is based on the idea that as the problem size grows, the complexity can be described as a simple proportionality to some known function. This idea is incorporated in the "Big Oh" notation for asymptotic performance. Other forms of asymptotic analysis "Big Omega", "Little Oh", "Theta" are similar in spirit to Big Oh, but will not be discussed in this handout.

When we use Big Oh analysis, we usually choose the function f n to be as small as possible and still satisfy the definition of Big Oh. The following functions are often encountered in computer science Big Oh analysis: This is called constant growth.

T n does not grow at all as a function of n, it is a constant. It is pronounced "Big Oh of one. A[i] takes the same time independent of the size of the array A. This is called logarithmic growth. T n grows proportional to the base 2 logarithm of n. It is pronounced "Big Oh of log n.

This is called linear growth. T n grows linearly with n. It is pronounced "Big Oh of n. This is called "n log n" growth. T n grows proportional to n times the base 2 logarithm of n. It is pronounced "Big Oh of n log n. In fact, no sorting algorithm that uses comparison between elements can be faster than n log n. This is called polynomial growth. T n grows proportional to the k-th power of n. We rarely consider algorithms that run in time O nk where k is greater than 5, because such algorithms are very slow.

For example, selection sort is an O n2 algorithm. It is pronounced "Big Oh of n squared. T n grows exponentially. It is pronounced "Big Oh of 2 to the n. The growth patterns above have been listed in order of increasing "size. The constant time might be used to prompt the user for a filename and open the file.

Neither of these operations are dependent on the amount of data in the file. After these setup operations, we read the data from the file and do something with it say print it.

The amount of time required to read the file is certainly proportional to the amount of data in the file.CS Lecture Notes - Bit Operations.

January, Latest Revision: January, James S. Plank I have lecture notes for this problem here, and often go over it in class. SRM D1 pointer (OthersXor): This is a .

## Copy Constructor and Assignment Operator

The midterm is open-book/open-notes/open laptop (no internet). It will tentitavely take place on Wednesday, November 7, Advice on applying machine learning: Slides from Andrew's lecture on getting machine learning algorithms to work .

Contents Tableofcontentsii Listofﬁguresxvii Listoftablesxix Listofalgorithmsxx Prefacexxi Syllabusxxii Resourcesxxvi Internetresourcesxxvii Lectureschedulexxviii.

CSLecturenotes Andrew Ng Supervised learning Let’s start by talking about a few examples of supervised learning problems.

Suppose we have a dataset giving the living areas and prices of 47 houses. CMSC Lecture Notes: Asymptotic Analysis.

A programmer usually has a choice of data structures and algorithms to use. Choosing the best one for a particular job involves, among other factors, two important measures.

11/27/12 1 1 CS Fall Lecture 11/27 Sorting Prof. Tanya Berger-Wolf 2 Lecture outline bogo sort bubble sort selection sort insertion sort.

CSA/CSW - Unsupervised Deep Learning