cs161: Data Structures and Algorithms Handout #1 Michael Goldwasser Stanford University Tuesday, June 25, 1996

Basic Course Information

Data Structures and Algorithms

Data Structures and Algorithm is a basic course on the design and analysis of algorithms. On one hand, the course will focus on presenting general techniques for designing efficient algorithms, such as dynamic programming, divide and conquer, greedy methods, etc. On the other hand, we will study how to compare different algorithms by formally analyzing their complexity (e.g. running time). The problems will will study involve sorting, searching, graph algorithms, computational geometry, and a sprinkling of other topics which vary from year to year. The techiques we look at include, divide and conquer, use of randomization, dynamic programming, approximation algorithms, and using parallelism.

The people

• Instructor: Michael Goldwasser

e-mail:  wass@cs.stanford.edu

office:  Gates 482
telephone: 723-4532
office hours: Tu/Th 3:05–4:30pm (or by appointment – Tu/Th).

• Teaching Assistant: Iacovos Koumas

e-mail:  koumas@cs.stanford.edu

office:  Gates 193B
telephone: 723-6077
office hours: M 4:00–6:00 pm

• Secretary: Phyllis Winkler

e-mail:  winkler@cs.stanford.edu

office:  Gates 495
telephone: 723-4377

The lectures

• Class Lectures: Prof. Michael Goldwasser

time:  Tuesday/Thursday, 1:15–3:05pm
place:  Skilling 191
broadcast: Stanford channel E4 (live)

• Recitation Section: Iacovos Koumas

time:  Friday, 1:15–2:05pm
place:  Skilling 193
broadcast: Stanford channel E4 (live)

Prerequisites

The official prerequisite for this course is CS109AB (Introduction to Computer Science) or the equivalent. Although this course will be entirely a “pen-and-paper” course, (i.e. no programming), familiarity with programming concepts such as pointers, arrays, records, procedures, and recurssion will be needed.

In addition, a solid background in mathematics will prove invaluable for this course, in that we will argue formally about the correctness and performance of almost every algorithm and data structure we introduce. The ability to write clear and formal proofs will be relied upon.

Course Mechanics

The primary goal of this course is to teach you how to design and analyze algorithms and data structures. The material will be presented in two weekly lectures. The lectures will be nearly two hours long, and so class participation is encouraged during class. In addition, there will be a recitation section once each week, for which attendance is recommended.

• Homework (50%) There will be six weekly homework assignments, on which students are to work alone. For your overall grade, we will throw out the lowest of your six homeworks. They will be handed out on Tuesday in class, and will be due the following Tuesday, at the beginning of class. Since it is important to stay up-to-date, and a new homework will go out each Tuesday, no late homeworks will be accepted. Each homework will consists of some suggested practice problems, and then four or five required problems which you will turn in. Throughout this course, problems will require a formal proof by default. Try to be both clear and precise. The organization of your solutions is just as important as the correctness.

• Midterm (20%) In the fourth week, we will give a take-home midterm in place of a homework assignment. Effectively, the midterm has weight equal to a “double-homework.” The format for the midterm will be similar to the homeworks, except that it may be more comprehensive.

• Final (30%) This final will be in-class, and closed book. It is intended to test both breadth and depth of understanding, and will consists of a variety of both short answer and more involved questions.

• Extra Credit (5%) Most of the homeworks, and each of the exams will have an extra credit problem. Your scores on these questions will be kept independently of the rest of the scores, and your total extra credit score for the class will add up to 5% on top of the overall grade.

Online Information

 Web Page: http://www-leland.stanford.edu/class/cs161
 Directory: /usr/class/cs161

             ftp://ftp.stanford.edu/class/cs161

 Newsgroup: su.class.cs161

We will attempt to keep all online information related to the course up-to-date. Announcements regarding homework problems, common questions, etc will be posted to the newsgroup as necessary. As this is also the place to look for late breaking news, it is important to check this newsgroup regularly.

There will be a class web page, to provide current information about office hours, lecture topics, due dates, and pointers to electronic copies of all handouts.

Electronic copies of all handouts will also be available in the class directory on leland, in postscript, dvi, and latex formats. You may access them through a “leland” account if you have one, or through anonymous ftp at

ftp.stanford.edu in the directory /class/cs161/.

Textbook

The required textbook for this class is Introduction to Algorithms by Cormen, Leiserson, and Rivest (CLR). Other good references include:

• Design and Analysis of Computer Algorithms, Aho and Ullman, Addison-Wesley, 1974.

• Data Structures and Algorithms, Aho and Ullman, Addison-Wesley, 1985.

• The Art of Computer Programming, Vol. 1–3, Knuth, Addison-Wesley, 1973–.

• Randomized Algorithms, Motwani and Raghavan, Cambridge Press, 1995.

• Algorithms, Sedgewick, Addison-Wesley, 1988.

• An Introduction to the Analysis of Algorithms, Sedgewick and Flajolet, Addison-Wesley, 1996. cs161: Handout #1 4

Schedule (subject to change)

# Date  Topic  Reading  Due Out
1 Tues.  Introduction, Admin.,  Ch. 1, 2  hw1
June 25 Asymptotics, Sorting
2 Thur.  Recursion, Divide & Conquer, Ch. 3, 4
June 27 Master Theorem
3 Tues. Lower Bound for Sorting, Ch. 9, 10.1, 10.3 hw1 hw2
July 2  Linear Sorts, Order Statistics

Thur. July 4

4 Tues.  Priority Queues, Heaps,  Ch. 7, 13.1–13.3, hw2 hw3
July 9  Dynamic Sets, Search Trees  and pp. 197–198
5 Thur.  Balanced Trees  Ch. 14

July 11

6 Tues. Augmented Data Ch. 15 hw3 Mid
July 16 Structures
7 Thur. Randomization, Quicksort, Ch. 6, 8,
July 18 Median Finding, Treaps  10.2, 13.4
8 Tues. Skip Lists and Hashing Ch. 12 and Mid hw4
July 23  additional reading
9 Thur. Dynamic Programming Ch. 16

July 25

10 Tues. Graphs (1 of 3) Ch. 5.4, 23 hw4 hw5
July 30 The basics
11 Thur. Graphs (2 of 3) Ch. 24
Aug. 1  Spanning Trees
12 Tues. Graphs (3 of 3) Ch. 25 hw5 hw6
Aug. 6  Shortest Paths
13 Thur. Computational Geometry Ch. 35

Aug. 8

14 Tues. Advanced Topics parts of hw6
Aug. 13 (dead week)  Ch. 30, 37
15 Thur.  Review
Aug. 15 (dead week)
F Saturday Final Exam  Final Final
Aug. 17 (12:15–3:15)