module1

# module1 - CS 240 Module 1 Introduction and Analysis of...

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

CS 240 Module 1 Introduction and Analysis of Algorithms Douglas R. Stinson David R. Cheriton School of Computer Science University of Waterloo Fall 2011 8 / 46

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

View Full Document
Course Objectives: What is This Course About? In a nutshell, the objective of the course is to study eﬃcient methods of storing, accessing, and performing operations on large collections of data. We will consider various abstract data types (ADTs) and how to implement them eﬃciently using appropriate data structures . Typical operations include: inserting new data items, deleting data items, searching for speciﬁc data items, sorting. There is a strong emphasis on mathematical analysis in the course. Algorithms are presented using pseudocode and analyzed using order notation (big-oh, etc.). 9 / 46
Course Topics priority queues and heaps sorting, selection binary search trees, AVL trees, B-trees skip lists hashing quadtrees, kd-trees range search tries string matching data compression 10 / 46

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

View Full Document
CS Background arrays, linked lists strings stacks, queues abstract data types recursive algorithms binary trees sorting binary search binary search trees 11 / 46
Problems (terminology) Problem: Given a problem instance, carry out a particular computational task. Problem Instance: Input for the speciﬁed problem. Problem Solution: Output (correct answer) for the speciﬁed problem instance. Size of a problem instance: Size ( I ) is a positive integer which is a measure of the size of the instance I (informally, this corresponds to the amount of input to a program solving the given problem). 12 / 46

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

View Full Document
Sorting Problem Problem Instance: An instance I consists of collection (list) of n integers. Problem Solution: A list of the n given integers which is sorted in increasing (or decreasing) order. Size of the problem instance: Size ( I ) = n . 13 / 46
Algorithms and Programs Algorithm: An algorithm is a step-by-step process (e.g., described in pseudocode) for carrying out a series of computations, given an arbitrary problem instance I . Algorithm solving a problem: An Algorithm A solves a problem Π if, for every instance I of Π, A ﬁnds a valid solution for the instance I in ﬁnite time. Program: A program is an implementation of an algorithm using a speciﬁed computer language. In this course, our emphasis is on algorithms (as opposed to programs or programming). 14 / 46

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

View Full Document
Eﬃciency of Algorithms/Programs How do we decide which algorithm or program is the the best or most eﬃcient solution to a given problem? In this course, we are primarily concerned with the amount of time a program takes to run. We also may be interested in the amount of memory the program requires. The amount of time and/or memory required by a program will depend on the amount of input used to specify the given problem instance I (recall that we denote this by Size ( I )).
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 02/21/2012 for the course PSYCH 101 taught by Professor Ennis during the Winter '09 term at Waterloo.

### Page1 / 39

module1 - CS 240 Module 1 Introduction and Analysis of...

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

View Full Document
Ask a homework question - tutors are online